Back to skill

Security audit

Redis Context Cache Free

Security checks for vulnerabilities and agentic risk

Overview

This Redis guide is mostly coherent, but it can lead an agent to change live Redis data and global Redis settings without enough guardrails.

Install only if you want a Chinese Redis operations guide and are comfortable supervising every command it suggests. Before using it with exec, require the agent to identify the Redis host/database, distinguish staging from production, show the exact keys or settings it will change, capture current CONFIG values, and get explicit confirmation before DEL, PERSIST, EXPIRE changes, EVAL scripts, or CONFIG SET commands.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:334
Finding

Non-Atomic Fixed-Window Rate Limiter Can Leave Persistent Keys

Content
View full analysis
100: reject ``` ### Technical Analysis The counter increment and TTL assignment are performed as two independent Redis commands. Redis guarantees atomicity for each command, but not for the sequence as a whole. If the client crashes, disconnects, times out, or is terminated after `INCR` succeeds but before `EXPIRE` executes, the counter remains without an expiration. Because the key includes the minute, it may no longer participate in rate-limit decisions, but it remains stored indefinitely and consumes memory. The unconditional `EXPIRE` also refreshes the key's TTL on every request instead of assigning it only when the counter is first created. This makes the key lifecycle dependent on the most recent request rather than the intended fixed-window boundary. ### Attack Path 1. An attacker sends requests that create many distinct rate-limit keys, such as requests associated with numerous spoofable or attacker-controlled identifiers. 2. Each request causes the application to execute `INCR`. 3. The attacker exploits or amplifies connection instability, worker termination, timeouts, or service overload so that some executions stop before `EXPIRE`. 4. Successfully incremented keys from interrupted executions retain no TTL. 5. Repeating the process accumulates stale keys and increases Redis memory consumption. ### Impact Assessment This issue does not grant operating-system privileges or direct access to protected Redis data. Its scope is the Redis database used by the limiter. Potential impact includes: - Persistent accumulation of stale rate-limit keys - Increased Redis memory consumpti ...[truncated 257 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:388
Finding

Sliding-Window Rate Limiter Is Vulnerable to Concurrent Request Races

Content
View full analysis
100: reject else: allow EXPIRE ratelimit:{user_id} 120 ``` ### Technical Analysis The sliding-window operation is split across separate insertion, cleanup, counting, authorization, and expiration steps. Although each Redis command is individually atomic, the complete rate-limit decision is not. Concurrent clients can interleave these operations and observe intermediate states. The application also makes the authorization decision outside Redis, so there is no single atomic operation that records a request and returns a definitive allow-or-deny result. A failure after `ZADD` but before `EXPIRE` can leave a sorted-set key without a TTL. Client-supplied time also creates consistency risks when application nodes have clock skew or when the timestamp is influenced by untrusted input. ### Attack Path 1. An attacker sends a burst of parallel requests for the same rate-limit identity. 2. Multiple workers independently execute the sorted-set commands. 3. Their `ZADD`, cleanup, count, and decision operations interleave. 4. Workers make authorization decisions based on state that can change before the decision is enforced. 5. Requests exceeding the intended threshold may be processed because the decision is not bound to one atomic server-side operation. 6. If workers fail after insertion but before expiration, affected limiter keys can remain indefinitely. 7. The attacker repeats the burst or creates many identities to amplify bypass and memory-consumption effects. ### Impact Assessment This issue does not provide system-level privilege escalation. It affects controls that rely on this Redis rate limiter. Potential i ...[truncated 338 chars]
Remediation
View remediation
limit then return {0, count} end return {1, count} ``` For strict enforcement, consider removing the newly added member when the request is rejected. Ensure member identifiers are unique, validate key components, monitor namespace size, and load-test the script under high concurrency. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:249
Finding

Hard-Coded Instance-Wide Redis Configuration Can Cause Unintended Data Eviction

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document contains commands that modify or delete Redis data and configuration, but it lacks a prominent consolidated warning about operational impact, environment targeting, and rollback. In an agentic setting, users may trigger DEL, SET/EXPIRE changes, lock operations, or later CONFIG SET commands against production by mistake, causing data loss, cache invalidation, outages, or service instability.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 192)May include surrounding context.

HGET user:1 email

text

**优势**:相比JSON String,Hash支持字段级原子更新,内存占用更小(ziplist编码)。

**输入**: 用户提供功能2:欠用的数据结构所需的指令和必要参数。
**处理**: 按照skill规范执行功能2:欠用的数据结构操作,遵循单一意图原则。

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description limits scope to Redis context caching practices around expiration, atomicity, memory management, and common patterns. However, the file goes beyond cache usage guidance and includes operational commands like CONFIG SET maxmemory and CONFIG SET maxmemory-policy, which change instance-wide Redis configuration and affect the whole server, not just an agent's context cache.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill declares a very broad capability coverage using vague scenario keywords and says execution should use input_params for create/query/export operations, without clear activation boundaries or safety gating. In an agent environment with exec/read tools, this increases the chance the agent will apply the skill in unintended contexts and issue destructive Redis commands or configuration changes without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The '免费版限制' section claims the free version does not include 'INFO命令详解、慢查询分析、命中率监控'. Earlier, the skill already instructs INFO memory usage and presents it as part of core memory-management guidance, which contradicts the stated exclusion of INFO-related monitoring content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest describes Redis context caching practices, yet the guide teaches Redis Streams as a reliable message queue and discusses AOF/RDB persistence choices. Those are broader Redis platform topics and not obviously required to implement context caching best practices.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

版权声明中明确写出“完全中文化表达”,且整份技能内容实际仅提供中文说明,没有给出可选语言或用户偏好机制。对于通用型技能,这构成了语言/locale 约束,但文档未说明该限制为用户可选或特定合规需求。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The limitations state the free version does not include 'Redis Cluster分片、Hash Tag、MOVED重定向处理'. However, the pitfalls table explicitly includes '跨槽位MGET' and recommends '用Hash Tag确保同槽', which is cluster-specific guidance and directly conflicts with the stated exclusion.

Content

No source excerpt is available for this finding.