# CVE-2024-48964: OS Command Injection in Snyk gradle plugin

> Attackers can execute arbitrary code by tricking users into scanning malicious Gradle projects with Snyk CLI.

- **Severity:** High 7.5 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 23 Oct 2024
- **Updated:** 24 Oct 2024
- **Also known as:** GHSA-qqqw-gm93-qf6m

## What is CVE-2024-48964?

CVE-2024-48964 is a high-severity code injection vulnerability in Snyk Cli, published on 23 Oct 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The package Snyk CLI before 1.1294.0 is vulnerable to Code Injection when scanning an untrusted Gradle project. The vulnerability can be triggered if Snyk test is run inside the untrusted project due to the improper handling of the current working directory name. Snyk recommends only scanning trusted projects.

Weakness: CWE-94 (Improper Control of Generation of Code), CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2024-48964?

2 open source packages ship an affected version, including snyk-gradle-plugin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `snyk-gradle-plugin` | npm | All versions | 4.5.0 |
| `snyk-gradle-plugin` | npm | All versions | 4.5.0 |

Products: Snyk Snyk Cli.

## How do I fix CVE-2024-48964?

Upgrade snyk-gradle-plugin to 4.5.0 or later.

## Is CVE-2024-48964 being exploited?

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

## Other vulnerabilities in Snyk Cli

- [CVE-2024-48963](https://insights.sbomify.com/CVE-2024-48963/): OS Command Injection in Snyk php plugin (high 7.5)
- [CVE-2022-24441](https://insights.sbomify.com/CVE-2022-24441/): Code Injection (medium 5.8)
- [CVE-2022-22984](https://insights.sbomify.com/CVE-2022-22984/): Command Injection (medium 5.0)
- [CVE-2025-6624](https://insights.sbomify.com/CVE-2025-6624/): Snyk CLI Insertion of Sensitive Information into Log File allowed in DEBUG or DEBUG/TRACE mode (low 2.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-48964 and fix it if it is affected.

What it is: CVE-2024-48964 is a high-severity code injection vulnerability in Snyk Cli, published on 23 Oct 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-48964 in the wild and no public exploit code.

Affected packages and fixed versions:
- snyk-gradle-plugin (npm): affected all versions; fixed in 4.5.0
- snyk-gradle-plugin (npm): affected all versions; fixed in 4.5.0

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-2024-48964/ (Markdown: https://insights.sbomify.com/CVE-2024-48964/index.md)
```

## Sources

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

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