# CVE-2025-58178: Command Injection via sonarqube-scan-action GitHub Action

> Attackers can execute arbitrary commands via unsanitized input in the SonarQube Scan GitHub Action, requiring an upgrade to the latest version.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 2 Sep 2025
- **Updated:** 2 Sep 2025
- **Also known as:** GHSA-f79p-9c5r-xg88

## What is CVE-2025-58178?

CVE-2025-58178 is a high-severity command injection vulnerability in SonarSource sonarqube-scan-action, published on 2 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

SonarQube Server and Cloud is a static analysis solution for continuous code quality and security inspection. In versions 4 to 5.3.0, a command injection vulnerability was discovered in the SonarQube Scan GitHub Action that allows untrusted input arguments to be processed without proper sanitization. Arguments sent to the action are treated as shell expressions, allowing potential execution of arbitrary commands. A fix has been released in SonarQube Scan GitHub Action 5.3.1.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2025-58178?

1 open source package ship an affected version, including SonarSource/sonarqube-scan-action.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `SonarSource/sonarqube-scan-action` | GitHub Actions | From 4.0.0 | 5.3.1 |

## How do I fix CVE-2025-58178?

Upgrade SonarSource/sonarqube-scan-action to 5.3.1 or later.

## Is CVE-2025-58178 being exploited?

There is no known exploitation of CVE-2025-58178 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-58178 and fix it if it is affected.

What it is: CVE-2025-58178 is a high-severity command injection vulnerability in SonarSource sonarqube-scan-action, published on 2 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-58178 in the wild and no public exploit code.

Affected packages and fixed versions:
- SonarSource/sonarqube-scan-action (GitHub Actions): affected from 4.0.0; fixed in 5.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-58178/ (Markdown: https://insights.sbomify.com/CVE-2025-58178/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-58178
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-58178
- OSV: https://osv.dev/vulnerability/CVE-2025-58178

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-58178/
Summaries are generated and may contain mistakes; the official description above is the record.
