Back to skill

Security audit

dat-test-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent ByteRover metrics reporter, but it needs review because its runtime instructions and script can execute unpinned or unintended shell code in some environments.

Review before installing or running, especially in CI or cron. Prefer a pinned local dependency instead of unversioned npx, and do not run it with BRV_CMD or BRV_SINCE values from untrusted sources until the script uses argument-array execution and validates its inputs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
metrics.ts:64
Finding

Shell Command Injection Through Unvalidated Environment Variables

Content
View full analysis
(subcommand: string, limit: number, since?: string, cwd?: string): T[] { const sinceFlag = since ? ` --since=${since}` : '' try { const raw = execSync(`${BRV} ${subcommand} --format=json --limit=${limit}${sinceFlag}`, { encoding: 'utf8', ``` ### Technical Analysis The script reads `BRV_CMD` and `BRV_SINCE` from environment variables and interpolates them directly into a command string passed to `execSync`. String-form `execSync` executes the command through a system shell. Consequently, shell metacharacters contained in either environment variable are interpreted as command syntax rather than treated as literal argument content. No allowlist validation, shell escaping, or argument-array separation is applied. For example, a value such as `BRV_SINCE='24h; id'` causes the appended command to be executed after the intended `brv` invocation. `BRV_CMD` is likewise vulnerable and controls the beginning of both commands executed by the script. Although the values may normally be set by a trusted operator, environment variables are often inherited from CI jobs, cron environments, process supervisors, wrappers, or other automation. If an attacker can influence either variable, this flaw converts configuration control into arbitrary command execution. ### Attack Path 1. An attacker gains the ability to influence `BRV_CMD` or `BRV_SINCE` in the script's environment, such as through a CI variable, cron configuration, wrapper script, or deployment setting. 2. The attacker supplies shell syntax in the value, for example: ```sh BRV_SINCE='24h; id' ``` 3. The script constructs a command resembling: ```sh brv query-log view --format=json --limit=100 ...[truncated 976 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:33
Finding

Unpinned Runtime Dependency Executed Through npx

Content
View full analysis
Remediation
View remediation
" } } ``` 2. Commit the corresponding package lockfile and use deterministic installation commands such as `npm ci` in CI and other automated environments. 3. Update the documentation to use the locked local dependency through a package script: ```sh npm run metrics -- --cwd=~/my-project ``` 4. If `npx` must be retained, specify an exact reviewed version and configure it not to silently select an unrelated local executable. A committed lockfile and local package script remain preferable. 5. Use a trusted registry configured over TLS, protect registry credentials and configuration, and consider dependency integrity or provenance verification supported by the deployment environment. 6. Establish a controlled dependency-update process that includes review, automated vulnerability scanning, and testing before changing the pinned version. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The core behavior matches the stated metrics-reporting purpose: it invokes ByteRover log/curate views, parses JSON, summarizes counts, durations, file changes, and quota errors, and outputs a report. However, the description specifically claims it 'Accepts one or more project directories via --cwd to report per-project stats.' The code only searches for a single argument starting with '--cwd=', extracts one path, and generates one aggregate report for that single cwd. There is no loop over multiple directories or per-project breakdown. This is a material description/behavior mismatch in supported input scope, though the primary purpose otherwise aligns.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
88% confidence
Finding

The skill contains output-shaping instructions such as 'Output ONLY' and 'Do NOT narrate reasoning, thinking steps, or tool call decisions,' which can act as prompt-level constraints that suppress transparency and interfere with higher-priority security or auditing instructions. In an agent setting, such directives can be used to hide unsafe behavior or prevent disclosure of diagnostic context after tool execution failures.

Content

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

md
When the user provides a list of project paths, run the script once per path and present each as a separate section in your response.

## Output Rules

- Output ONLY the formatted metrics summary below — nothing else
- Do NOT narrate reasoning, thinking steps, or tool call decisions

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description and usage guidance say to use the skill when asked to report ByteRover health, and give examples like "how is ByteRover doing?" and "show usage stats." Those phrases are relatively broad and there is no explicit constrained trigger list or negative example clarifying when similar generic requests should not invoke this skill outside the ByteRover metrics context.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

Using npx tsx without a pinned package version introduces supply-chain risk because package resolution can drift over time or retrieve a compromised dependency version. In an automated or privileged environment, this can result in execution of untrusted code during routine metrics collection.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This is the same underlying issue: the shebang usage guidance relies on npx tsx without version pinning, creating a supply-chain execution risk. In a security-sensitive agent skill, even a metrics/reporting tool is dangerous because operators may copy-paste the command and unknowingly run a remote package version.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
metrics.ts:67