Back to skill

Security audit

Dr.Binary

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its binary-analysis purpose, but it uploads files to a remote sandbox and silently loads all values from a shared .env file.

Install only if you are comfortable sending selected binaries to the remote Dr. Binary/Deepbits analysis service. Do not use it for confidential samples without approval, and avoid placing unrelated secrets in the shared .env path this helper reads; prefer providing only DRBINARY_API_KEY explicitly.

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
upload.py:25
Finding

Overbroad Loading of Secrets from an Ancestor Environment File

Content
View full analysis
None: env_file = Path(__file__).parent.parent.parent / ".env" if not env_file.is_file(): return for line in env_file.read_text().splitlines(): line = line.strip() if line and not line.startswith("#") and "=" in line: key, _, value = line.partition("=") os.environ.setdefault(key.strip(), value.strip()) ``` ### Technical Analysis The script needs only `DRBINARY_API_KEY`, but `load_env()` reads an ancestor `.env` file and copies every parsed key/value pair into the process environment. This violates least privilege by exposing unrelated credentials and configuration values to the entire Python process. The ancestor path is selected implicitly using `Path(__file__).parent.parent.parent`, and this behavior is not documented in `SKILL.md`. Any imported module, tracing hook, exception reporter, subprocess added in a future revision, or other code executing in the same process could access the additional secrets through `os.environ`. The current reviewed implementation does not transmit these unrelated environment variables, execute subprocesses, or contain evidence of intentional credential exfiltration. Exploitation therefore requires another component capable of reading the process environment. Nevertheless, loading unnecessary secrets expands the impact of a compromised dependency or later code change. ### Attack Path 1. A user or deployment places `upload.py` under a directory hierarchy whose third-level ancestor contains a `.env` file. 2. That file contains `DRBINARY_API_KEY` together with unrelated secrets such as cloud credentials, database passwords, or service tokens. 3. The user invokes `upload.py`, causing `load_env()` to parse the ancestor `.env`. 4. Every pa ...[truncated 1102 chars]
Remediation
View remediation
None: env_file = Path(__file__).resolve().parent / ".env" if not env_file.is_file() or "DRBINARY_API_KEY" in os.environ: return for raw_line in env_file.read_text(encoding="utf-8").splitlines(): line = raw_line.strip() if not line or line.startswith("#") or "=" not in line: continue key, _, value = line.partition("=") if key.strip() == "DRBINARY_API_KEY": os.environ["DRBINARY_API_KEY"] = value.strip() return ``` 3. Use a predictable, documented configuration location rather than traversing implicitly to a shared ancestor directory. 4. Validate that the configuration file is a regular file owned by the expected user and is not writable by untrusted users where the deployment model permits such checks. 5. Keep the API key in a dedicated secret store or narrowly scoped environment variable rather than a shared `.env` containing unrelated credentials. 6. Document the exact credential-loading behavior and the external upload destination so users can make an informed decision before processing sensitive binaries. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (7)

Tainted flow: 'req' from os.environ.get (line 58, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · upload.py (reported line 68)May include surrounding context.

python
},
    )

    with urllib.request.urlopen(req) as resp:
        result = json.loads(resp.read().decode())

    return f"/sandbox/{result['pathname']}"

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a binary analysis aid, but its documented behavior includes uploading local binaries to a third-party service and relying on external infrastructure for analysis. This mismatch is dangerous because users may provide sensitive binaries under the assumption analysis is local, leading to unanticipated disclosure of proprietary or malicious samples and possible leakage of credentials or internal artifacts.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

Accessing a repository-level .env file is a form of credential access because it can ingest secrets stored for other tooling or components in the workspace, not just the one API key needed here. In a shared agent repository, this broad secret-loading behavior increases the blast radius if the skill is modified, abused, or combined with additional network sinks.

Content

Scanner excerpt · upload.py (reported line 27)May include surrounding context.

python
def load_env() -> None:
    env_file = Path(__file__).parent.parent.parent / ".env"
    if not env_file.is_file():
        return
    for line in env_file.read_text().splitlines():

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes capabilities that can access environment secrets, read local files, use the shell, and communicate over the network, but it does not declare any tool scope restrictions or permissions boundaries. That makes the skill harder to audit and increases the chance of unintended file exfiltration or command execution beyond what a user would reasonably expect from the metadata alone.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs the operator to upload a local binary to a remote sandbox without warning that the file contents leave the system. In the context of malware triage and reverse engineering, binaries are often confidential, regulated, or operationally sensitive, so silent transmission to a third party creates real confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reads a repository-level .env file and imports arbitrary key-value pairs into the process environment, which expands its access to secrets beyond what is necessary for a simple binary upload helper. In an agent-skill context, this is risky because the skill can silently consume credentials from a shared workspace, increasing the chance of unintended secret exposure or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code uploads arbitrary local file contents to an external service and includes an API credential, but it provides no explicit user-facing warning, consent step, or guardrail in the upload path. In a binary-analysis skill this behavior is functionally relevant, yet still dangerous because users may not realize sensitive binaries or proprietary samples are being transmitted off-host.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.