Back to skill

Security audit

Memory Cache

Security checks for vulnerabilities and agentic risk

Overview

This Redis cache skill is mostly purpose-aligned, but its scan command can expose unrelated Redis key names despite claiming strict namespacing.

Review before installing if the Redis database is shared or contains business data. Use a dedicated Redis database or ACL restricted to mema:* keys, avoid storing secrets or sensitive prompts unless Redis is trusted and access-controlled, and prefer pinned dependency versions or a lockfile.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/cache_manager.py:129
Finding

Redis Namespace Restriction Bypass Allows Enumeration of Unrelated Keys

Content
View full analysis

Vulnerability Details

File Location: scripts/cache_manager.py:129-135 and scripts/cache_manager.py:176-177
Vulnerability Type: Insufficient namespace access control
Risk Level: Medium

Vulnerable Code:

python
def scan_keys(pattern: str, count: int = 100) -> list[str]:
    if not pattern.startswith(KEY_PREFIX) and "*" not in pattern:
        pattern = f"{KEY_PREFIX}*" if pattern == "*" else f"{KEY_PREFIX}*{pattern}*"
    r = _client()
    try:
        return list(r.scan_iter(match=pattern, count=count))
    except redis.RedisError as e:
        raise CacheError(str(e))
python
p_scan = subparsers.add_parser("scan", help="List keys by pattern (SCAN, safe for production)")
p_scan.add_argument("pattern", default="*", nargs="?", help="Glob pattern (default: mema:*)")

Technical Analysis

The skill claims to enforce the mema: Redis namespace, but scan_keys() does not validate scan patterns using the same namespace restrictions applied to individual key operations.

The default pattern is "*". Because this pattern contains an asterisk, the following condition evaluates to false:

python
if not pattern.startswith(KEY_PREFIX) and "*" not in pattern:

Therefore, the default pattern is passed directly to Redis as SCAN MATCH *, rather than being rewritten to mema:*. Any user able to invoke the command can also provide another wildcard pattern that does not begin with mema: and bypass the intended namespace restriction.

Although this does not directly retrieve the values of non-mema: keys through the provided get command, it discloses their names. Redis key names commonly reveal application identifiers, tenant IDs, session structures, queue names, account references, and internal architecture.

Attack Path

  1. An attacker or untrusted agent obtains permission to invoke the cache skill against a Redis database shared with other applications.
  2. The a ...[truncated 1205 chars]
Remediation
View remediation

Remediation Suggestions

  1. Change the CLI default pattern from "*" to "mema:*":

    python
    p_scan.add_argument(
        "pattern",
        default="mema:*",
        nargs="?",
        help="Glob pattern restricted to mema:*",
    )
    
  2. Reject every pattern that does not begin with the required namespace:

    python
    def scan_keys(pattern: str, count: int = 100) -> list[str]:
        if not isinstance(pattern, str) or not pattern.startswith(KEY_PREFIX):
            raise KeyValidationError("Scan pattern must start with mema:")
        if count <= 0 or count > 1000:
            raise KeyValidationError("SCAN count must be between 1 and 1000")
    
        r = _client()
        try:
            return list(r.scan_iter(match=pattern, count=count))
        except redis.RedisError as e:
            raise CacheError(str(e))
    
  3. If users need shorthand search terms, construct the complete namespaced pattern internally rather than accepting an unrestricted Redis glob.

  4. Configure a dedicated Redis account with ACL rules limited to ~mema:*, so server-side authorization still prevents cross-namespace access if application validation fails.

  5. Prefer a dedicated Redis database or instance when the cache may contain data from mutually untrusted applications.

  6. Add regression tests covering "*", "other:*", "?:*", and other wildcard patterns to verify that none can escape the mema: namespace.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Automatically Installed Dependencies Use Unbounded Version Ranges

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-2, scripts/cache.sh:9-14, and SKILL.md:4
Vulnerability Type: Unpinned dependency installation and non-reproducible build
Risk Level: Low

Vulnerable Code:

text
redis>=5.0.0
python-dotenv>=1.0.0
bash
if [ ! -d "$VENV_DIR" ]; then
    echo "Initializing environment..."
    python3 -m venv "$VENV_DIR"
    source "$VENV_DIR/bin/activate"
    pip install -q --upgrade pip
    pip install -q -r "$REQ_FILE"
    echo "Environment ready."
else
    source "$VENV_DIR/bin/activate"
fi

The skill metadata also authorizes automatic dependency installation:

yaml
metadata: {"openclaw":{"requires":{"bins":["python3"],"env":["REDIS_URL"]},"install":[{"id":"pip-dependencies","kind":"exec","command":"pip install -r requirements.txt"}]}}

Technical Analysis

Both dependencies use open-ended minimum-version constraints. A future version satisfying these constraints can therefore be installed without having been reviewed with this skill. The wrapper additionally upgrades pip dynamically before installing dependencies.

Python package installation may execute package build backends or installation-related code. Package imports also execute module-level Python code. If a permitted upstream release or its distribution channel is compromised, the automatically selected package can execute code with the privileges of the user running installation or invoking the skill.

No evidence indicates that the currently named packages are malicious. The finding concerns the absence of exact version and integrity controls, which makes installations non-reproducible and unnecessarily expands supply-chain risk.

Attack Path

  1. A legitimate upstream package account, release pipeline, or package distribution artifact is compromised, or a future permitted release contains malicious code.
  2. A user runs scripts/cache.sh with ...[truncated 1178 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every runtime dependency to an exact, reviewed version:

    text
    redis==<reviewed-version>
    python-dotenv==<reviewed-version>
    
  2. Generate and commit a lockfile containing cryptographic hashes. Install with hash enforcement, for example:

    bash
    python3 -m pip install --require-hashes -r requirements.lock
    
  3. Remove the automatic pip install --upgrade pip operation. Pin and provision the package installer through the trusted runtime image or deployment process.

  4. Ensure the installation command in SKILL.md uses the same reviewed lockfile and integrity policy as the shell wrapper.

  5. Use a trusted, explicitly configured package index or an internal artifact repository rather than relying on unconstrained resolver defaults.

  6. Add dependency scanning and controlled update review to the release process. Regenerate hashes only after reviewing and testing each dependency update.

  7. Perform installation and execution under a dedicated, least-privileged account with restricted filesystem and network access.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly instructs users to provide a REDIS_URL and use Redis to store agent state, API results, and shared sub-agent data, but it does not warn that this data may be sent to a remote Redis instance outside the local trust boundary. Because the documented use cases include potentially sensitive session context and cached API data, users may unintentionally expose secrets, prompts, tokens, or internal state to an external service without understanding the privacy and security implications.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower-bound range (redis>=5.0.0) rather than an exact pinned version, which makes builds non-reproducible and can unexpectedly pull in vulnerable or incompatible releases over time. In a security-sensitive agent skill, this increases supply-chain risk because the actual installed version cannot be reliably audited against known advisories.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
redis>=5.0.0
python-dotenv>=1.0.0

Unverifiable Dependency: redis has 4 known advisory(ies) (CVE-2023-28858 (redis-py Race Condition vulnerability); CVE-2023-28859 (redis-py Race Condition due to incomplete fix); CVE-2023-28858 (redis-py before 4.5.3, as used in ChatGPT and other products, leaves a connectio) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The manifest references redis without pinning, while the package has multiple known advisories in some versions. Because the exact resolved version is unknown, the skill may install an affected release, and for a network/client library this can expose the application to real runtime security flaws rather than just build hygiene issues.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency python-dotenv is also unpinned, so installations may resolve to different versions across environments and times. This weakens reproducibility and makes it hard to verify whether the deployed version includes fixes for known security issues, creating avoidable supply-chain uncertainty.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
redis>=5.0.0
python-dotenv>=1.0.0

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The unpinned python-dotenv dependency prevents verification that the installed version is free from the listed advisories, including file-handling issues that could become meaningful if the skill writes or manages .env files. Even if the package is commonly benign, the lack of version control leaves open the possibility of resolving to a vulnerable release.

Content

No source excerpt is available for this finding.