Back to skill

Security audit

Deepseek Reasonix

Security checks for vulnerabilities and agentic risk

Overview

The skill does not show theft or destructive intent, but its claimed purpose is vague and its helper script uses an unsafe shared temporary cache that can corrupt files writable by the user in a local attack scenario.

Review this before installing. It appears more like an auto-generated tutorial/helper than a full DeepSeek coding agent, and its script should be fixed to use a private per-user cache with safe file creation before running it on a shared machine or privileged account.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
deepseek_reasonix.py:11
Finding

Predictable Shared Temporary Cache Permits Symbolic-Link File Overwrite

Content
View full analysis

Vulnerability Details

File Location: deepseek_reasonix.py, lines 11–42
Vulnerability Type: Insecure temporary-file handling and symbolic-link following
Risk Level: Medium

Vulnerable Code

python
def get_prefix_cache():
    cache_dir = pathlib.Path(tempfile.gettempdir()) / 'deepseek-reasonix'
    cache_dir.mkdir(exist_ok=True)
    return cache_dir

def hash_code(code):
    return hashlib.sha256(code.encode()).hexdigest()

def get_code_suggestions(code, context):
    # Simple suggestion engine, replace with a more sophisticated one
    suggestions = []
    for line in context.splitlines():
        if re.search(r'\b' + re.escape(code) + r'\b', line):
            suggestions.append(line.strip())
    return suggestions

def run(param=""):
    cache_dir = get_prefix_cache()
    code_context = get_code_context()
    code_hash = hash_code(code_context)
    cache_file = cache_dir / f'{code_hash}.json'

    if cache_file.exists():
        with cache_file.open() as f:
            cache_data = json.load(f)
    else:
        cache_data = {}

    if param:
        suggestions = get_code_suggestions(param, code_context)
        cache_data[param] = suggestions
        with cache_file.open('w') as f:
            json.dump(cache_data, f)

Technical Analysis

The cache is placed in the system-wide temporary directory under the predictable path deepseek-reasonix. Its filename is the SHA-256 hash of the script's static source code, so any local user who can read the package can calculate the exact cache path in advance.

The code does not:

  • Create a private cache directory with restrictive permissions.
  • Verify that the directory is owned by the invoking user.
  • Verify that the cache file is a regular file.
  • Reject symbolic links when opening the cache.
  • Use secure exclusive creation or atomic replacement.
  • Validate the size and struc ...[truncated 2474 chars]
Remediation
View remediation

Remediation Suggestions

  1. Store cache data in a per-user cache location rather than a system-wide predictable temporary directory, such as a platform-appropriate user cache directory.
  2. Create the cache directory with mode 0700 and verify that it is a real directory owned by the current user.
  3. Reject symbolic links and non-regular files. On supported platforms, open files using os.open() with O_NOFOLLOW, then verify the resulting descriptor with os.fstat().
  4. Write updates to a securely created temporary file in the verified cache directory, flush and close it, and atomically install it with os.replace().
  5. Apply restrictive file permissions such as 0600 to cache files.
  6. Validate existing cache files before loading them, including a reasonable maximum size, valid JSON structure, and expected key and value types.
  7. Treat ownership, type, or permission validation failures as unsafe cache state and refuse to read or overwrite the affected path.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Using the single word trigger "Claude" is dangerously overbroad because it is a common product/model term that may appear in many unrelated user conversations. This can cause unintended activation of the skill, leading the agent to inject irrelevant instructions or behavior into ordinary requests and increasing the risk of prompt-routing confusion or misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language policy checks apply to all file types. The file presents the skill in Chinese only, including headings and trigger guidance, without indicating user opt-in or an alternative language option, which can amount to a forced language choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The activation condition "用户需要deepseek-reasonix-f074f8-2bfb41-271d93-6e66ba相关帮助" is vague and lacks objective criteria for when the skill should activate. Ambiguous routing conditions can cause accidental invocation, unpredictable behavior, and make it harder to prevent the skill from interfering with unrelated tasks.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.