Back to skill

Security audit

sonarqube-review

Security checks for vulnerabilities and agentic risk

Overview

This skill is aimed at fixing SonarQube issues, but it includes broad automatic repository changes and insecure local scan behavior that should be reviewed before use.

Install only if you are comfortable letting the skill modify source, tests, .gitignore, generated review files, and possibly analysis configuration. Before use, disable or override the instruction to delete scanner configuration, avoid the local scan helper unless its token handling is fixed, and require local/pinned project tools instead of unpinned npx downloads.

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

T08 · Insecure Dependencies

Error
Location
references/validate-angular.sh:27
Finding
Unpinned npx Commands Can Retrieve and Execute Unreviewed Packages<![CDATA[ ## Vulnerability Details **File Location**: `references/validate-angular.sh:27-41`; `references/validate-js.sh:10-17` **Vulnerability Type**: Supply-chain exposure through unpinned package execution **Risk Level**: High ### Vulnerable Code ```bash # references/validate-angular.sh npx eslint src/ || { echo "❌ Error: eslint failed" exit 1 } npx prettier --write src/ || { echo "⚠️ Warning: Prettier failed, continuing..." } npx eslint --fix src/ || { echo "⚠️ Warning: ESLint --fix failed, continuing..." } ``` ```bash # references/validate-js.sh npx eslint src/ npx prettier --check src/ if grep -q "vitest" package.json; then npx vitest run --coverage elif grep -q "jest" package.json; then npm test -- --coverage else npm test fi ``` ### Technical Analysis The validation scripts invoke `eslint`, `prettier`, and `vitest` through `npx` without exact version constraints or an explicit requirement to resolve only packages already installed from the project's lockfile. If a requested executable is unavailable locally, `npx` can resolve and retrieve a package from the configured npm registry. This creates a remote code execution channel whose effective payload may change after the Skill has been reviewed. A compromised registry account, malicious registry configuration, dependency confusion condition, or later-compromised package release could cause attacker-controlled lifecycle or executable code to run. The implementation also conflicts with `SKILL.md:458-460`, which states that `npx` is allowed only with pinned versions. ### Attack Path 1. The Skill runs an Angular or JavaScript validation script in a target repository. 2. One or more requested executables are not present in the local `node_modules/.bin` directory, or npm is configured to use an attacker-influenced registry. 3. `npx` resolves the unpinned package name through the configured registry. 4. A compromised or substituted package is downloaded. 5. Package installatio ...[truncated 735 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require dependencies to be declared in the target project's manifest and resolved through a reviewed, integrity-protected lockfile. 2. Execute only local binaries, for example: ```bash test -x node_modules/.bin/eslint || { echo "eslint is not installed locally" >&2 exit 1 } ./node_modules/.bin/eslint src/ ``` 3. Alternatively, use an offline or local-only npm execution mode that fails rather than downloading an absent package. 4. If remote installation is explicitly necessary, pin every package to an exact reviewed version and use lockfile integrity validation. 5. Run `npm ci` rather than unconstrained installation where appropriate, and configure an approved registry. 6. Apply the same policy consistently to `eslint`, `prettier`, and `vitest` in both validation scripts. ]]>

other

Warning
Location
SKILL.md:375
Finding
Skill Directs Removal of Existing SonarQube and Build Configuration Outside the Required Fix Scope<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:375` **Vulnerability Type**: Destructive repository configuration modification **Risk Level**: Medium ### Vulnerable Instruction ```markdown - ✅ Remove SonarQube scanner files that may be present, such as `sonar-project.properties`, `sonar-scanner.properties`, etc. Also remove other scanners, such as the `SonarScanner for Maven` usually present in the POM.xml, since our pipeline is autonomous and does not depend on these files to work. (For now, keep only SonarQube-related configurations in `.csproj` files). ``` ### Technical Analysis The Skill instructs the Agent to remove existing scanner files and modify Maven configuration even when those changes are unrelated to the SonarQube issue being repaired. Scanner settings may be required by the target repository's CI/CD pipeline, local developer workflow, compliance controls, or deployment process. This instruction contradicts the same Skill's requirements to fix only issues listed in `sonarqube_issues.json` and to avoid unrelated changes. It also assumes that an unspecified autonomous pipeline supersedes the target project's existing configuration without validating that assumption or obtaining user approval. ### Attack Path 1. A user invokes the Skill to repair one or more SonarQube findings. 2. The Agent follows the completion guidance and locates existing SonarQube scanner files or Maven scanner configuration. 3. The Agent deletes those files or removes scanner configuration from `pom.xml`, despite the configuration not being the subject of a reported issue. 4. The resulting changes are included in the working tree and may be accepted during review. 5. Subsequent CI/CD runs lose required analysis settings, use incorrect defaults, or stop running the expected quality gate. ### Impact Assessment The instruction does not directly grant an attacker additional system privileges. Its impact is repository and pipeline integrity: it can disable or ...[truncated 223 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the blanket instruction to delete scanner files and Maven scanner configuration. 2. Preserve all existing build and analysis configuration by default. 3. Permit modification only when a specific downloaded SonarQube issue identifies that configuration and the proposed change is necessary to resolve it. 4. Require explicit user confirmation before deleting tracked configuration or changing CI/build integrations. 5. Present any proposed deletion in the review notes with its rationale, affected pipeline, and rollback procedure. 6. Validate the repository's CI configuration before concluding that a scanner file is obsolete. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/sonar-local-scan.sh:62
Finding
Local SonarScanner Uses a Default Administrative Credential and Exposes Tokens in Process Arguments<![CDATA[ ## Vulnerability Details **File Location**: `references/sonar-local-scan.sh:62-65` **Vulnerability Type**: Insecure credential handling **Risk Level**: Medium ### Vulnerable Code ```bash sonar-scanner \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.host.url="http://localhost:9000" \ -Dsonar.login="${SONAR_TOKEN:-admin}" ``` ### Technical Analysis The script silently falls back to the well-known value `admin` when `SONAR_TOKEN` is absent. This promotes operation with a predictable administrative credential rather than failing securely and requiring explicit authentication. When a real token is configured, the script supplies it as a command-line argument. Depending on the operating system, process-isolation configuration, scanner logging, and monitoring tools, command-line arguments may be visible to other local processes or recorded in telemetry. This conflicts with the Skill's stated objective of preventing token inspection and disclosure. The connection uses plaintext HTTP. Although the configured destination is localhost, traffic may still cross container, namespace, proxy, or port-forwarding boundaries in some environments. The audit did not establish that the token is sent to an unrelated external host. ### Attack Path 1. The Skill invokes the local scan script. 2. If no token is configured, the script attempts authentication using the predictable `admin` value. 3. If the local SonarQube service still accepts that credential, the scan runs through a weak or default account. 4. If a real `SONAR_TOKEN` is configured, it is expanded into the scanner process's argument list. 5. A same-host process, diagnostic collector, or command telemetry system with sufficient access may observe and retain the token. 6. A recovered token can then be used against the SonarQube instance within the permissions assigned to that token. ### Impact Assessment A disclosed token grants the permissions of the associated SonarQube account, potentially incl ...[truncated 311 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `admin` fallback and abort when no explicitly configured token is available: ```bash if [ -z "${SONAR_TOKEN:-}" ]; then echo "SONAR_TOKEN must be configured" >&2 exit 1 fi ``` 2. Pass authentication through the scanner's supported protected environment-variable mechanism rather than a command-line property. 3. Ensure scanner debug output and generated files cannot contain credentials. 4. Use HTTPS when the service is not guaranteed to remain entirely within a trusted local transport boundary. 5. Use a dedicated least-privilege scan token rather than an administrative account. 6. Document token rotation and revocation procedures in case process telemetry or logs have captured prior command lines. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill claims broad SonarQube deployment support and safe token handling, yet the finding suggests at least one referenced path may use hardcoded localhost behavior and default admin fallback. If true, that creates a dangerous trust gap: users may permit execution believing enterprise-safe handling exists while the underlying helper could authenticate insecurely or hit unintended targets.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The skill instructs removal of `sonar-project.properties`, scanner properties, and even SonarScanner-for-Maven configuration while claiming to stay narrowly within SonarQube-fix scope. Deleting repository security/quality configuration is a high-risk destructive action that can disable existing scanning, reduce governance, and silently weaken CI protections unrelated to the targeted issue fix.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill contains extensive shell-command guidance and script execution instructions but does not declare any explicit tool scope such as allowed-tools or permissions. That omission weakens execution boundaries and increases the chance an agent will invoke shell/network/file-modifying capabilities more broadly than a user expects.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs downloading issue data from SonarQube APIs using environment-backed credentials but lacks a clear top-level privacy/network disclosure. Because the workflow sends project identifiers, branch names, and issue metadata to a remote service, users may unknowingly authorize network egress and handling of potentially sensitive repository information.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill directs creation and modification of multiple repository files, including TODO boards, review notes, metrics HTML, `.gitignore`, and code/tests, without a prominent up-front warning that it will write to the workspace. Unexpected writes increase the risk of silent repository changes, user surprise, and accidental inclusion of generated artifacts.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
### Cleanup of Isolated Environments (Optional)

If the user asks to remove isolated environments after completion, **list the paths first and ask for explicit confirmation** before deleting anything. Do not run `rm -rf` or `find -exec rm -rf` without consent.

```bash
# List what would be removed (do not delete automatically)
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
At L579 the document says not to run programming scripts that require human validation before release because doing so reduces autonomy and creates extra work. However, the skill repeatedly instructs the agent to load and execute reference scripts such as `references/detect-stack.sh`, `references/download-issues.sh`, `references/jsonf.sh`, and `references/sonar-local-scan.sh` (for example L71, L89, L155, L199, L222, L224, L342-351), which is a direct contradiction in operational guidance.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The document states 'Language: English (en-us) for content,' which is a natural-language locale constraint. Although activation examples include Portuguese, the policy text requires English output/content and does not present this as optional or user-selectable.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The file header says this script is to 'run SonarQube locally and revalidate fixes', which implies executing a scan. In addition to scanning, it creates and appends to sonar-project.properties in the target project, permanently changing repository configuration rather than just performing validation.

Context-Inappropriate Capability

Medium
Confidence
81% confidence
Finding
For a skill intended to work on SonarQube issue analysis and fix validation, running sonar-scanner is expected, but generating and mutating project configuration files is a separate repository-editing capability. This is not clearly justified by a helper whose stated role is to run a local scan, especially because it chooses defaults like source/test paths and exclusions on behalf of the project.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a skill for automatically fixing SonarQube issues across projects and deployments, but this script performs generic Angular project validation: linting, formatting, tests, and production builds. It does not interact with SonarQube or appear scoped to SonarQube issue analysis, making the implemented behavior broader and different from the stated skill purpose.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
The script performs automatic source modification via `prettier --write` and `eslint --fix` even though the stated skill purpose is SonarQube review/validation. In an automated agent context, hidden write-side effects can silently alter repository contents, mask the original state under review, and introduce unintended changes before tests or builds, which is more dangerous because users may expect analysis rather than mutation.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Static analysis

No suspicious patterns detected.