CVE-2025-58178: SonarSource/sonarqube scan action Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-f79p-9c5r-xg88
CVSS 7.8
CWE-77
Published
Advisory Summary

CVE-2025-58178 is a HIGH (CVSS 7.8) command injection vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting SonarSource/sonarqube scan action libraries in the GitHub Actions ecosystem. The issue involves command injection via sonarqube-scan-action github action. Remediation is available by upgrading affected packages to version 5.3.1.

CVE-2025-58178 at a Glance

CVE Identifier CVE-2025-58178
GHSA Identifier GHSA-f79p-9c5r-xg88
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product SonarSource/sonarqube scan action
Package Ecosystem GitHub Actions
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-58178

To remediate this vulnerability, upgrade all affected SonarSource/sonarqube scan action dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

SonarSource/sonarqube-scan-action fixed: 5.3.1
Upgrade SonarSource/sonarqube-scan-action to 5.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for SonarSource/sonarqube-scan-action

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-58178, inspect your project dependencies for SonarSource/sonarqube scan action:

inspect dependencies for SonarSource/sonarqube-scan-action

Analyze the terminal output to locate any version of SonarSource/sonarqube scan action in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In SonarSource/sonarqube scan action, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact 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. ### Patches A fix has been released in SonarQube Scan GitHub Action v5.3.1.

CVE-2025-58178 Affected SonarSource/sonarqube scan action Versions

1 component(s)
Fixed Versions:
5.3.1
Product / Package Ecosystem Affected Versions Fixed Version
SonarSource/sonarqube-scan-action
GitHub Actions
≥ 4.0.0
< 5.3.1
5.3.1

References

Frequently Asked Questions

What is CVE-2025-58178?
CVE-2025-58178 is a security vulnerability in SonarSource/sonarqube scan action involving Command Injection via sonarqube-scan-action GitHub Action under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which SonarSource/sonarqube scan action versions are affected?
Affected versions include releases prior to 5.3.1 across affected packages: SonarSource/sonarqube-scan-action.
What version fixes CVE-2025-58178?
Upgrading to 5.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is SonarSource/sonarqube-scan-action affected?
Yes, SonarSource/sonarqube-scan-action is affected in releases prior to 5.3.1. Upgrade your dependency to 5.3.1 or later.
What is the CVSS score of CVE-2025-58178?
CVE-2025-58178 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-58178?
CVE-2025-58178 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check GitHub Actions dependencies for CVE-2025-58178?
Run the dependency tree command: 'inspect dependencies for SonarSource/sonarqube-scan-action'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f79p-9c5r-xg88",
  "modified" : "2025-09-02T17:31:57Z",
  "published" : "2025-09-02T17:31:57Z",
  "aliases" : [ "CVE-2025-58178" ],
  "summary" : "Command Injection via sonarqube-scan-action GitHub Action",
  "details" : "### Impact\nA 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.\n\n### Patches\nA fix has been released in SonarQube Scan GitHub Action v5.3.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "GitHub Actions",
      "name" : "SonarSource/sonarqube-scan-action"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "5.3.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.3.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/SonarSource/sonarqube-scan-action/security/advisories/GHSA-f79p-9c5r-xg88"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SonarSource/sonarqube-scan-action/pull/200"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/SonarSource/sonarqube-scan-action/commit/016cabf33a6b7edf0733e179a03ad408ad4e88ba"
  }, {
    "type" : "WEB",
    "url" : "https://community.sonarsource.com/t/security-advisory-sonarqube-scanner-github-action/147696"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/SonarSource/sonarqube-scan-action"
  }, {
    "type" : "WEB",
    "url" : "https://sonarsource.atlassian.net/browse/SQSCANGHA-101"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-02T17:31:57Z",
    "nvd_published_at" : null
  }
}