# CVE-2025-61584: serverless-dns is vulnerable to Command Injection through pr.yml GitHub Action Workflow

> Attackers can inject commands via GitHub Actions to push malicious code, leading to remote code execution for users of the DNS resolver.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 30 Sep 2025
- **Updated:** 30 Sep 2025
- **Also known as:** GHSA-9g7x-737f-5xpc

## What is CVE-2025-61584?

CVE-2025-61584 is a critical command injection vulnerability in serverless-dns, published on 30 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

serverless-dns is a RethinkDNS resolver that deploys to Cloudflare Workers, Deno Deploy, Fastly, and Fly.io. Versions through abd including 0.1.30 have a vulnerability where the pr.yml GitHub Action interpolates in an unsafe manner untrusted input, specifically the github.event.pull_request.head.repo.clone_url and github.head_ref, to a command in the runner. Due to the action using the pull_request_target trigger it has permissive permissions by default. An unauthorized attacker can exploit this vulnerability to push arbitrary data to the repository. The subsequent impact on the end-user is executing the attackers' code when running serverless-dns. This is fixed in commit c5537dd, and expected to be released in 0.1.31.

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

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


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

No fix has been published for CVE-2025-61584 yet. Limit exposure of the affected software until one is available.

## Is CVE-2025-61584 being exploited?

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

Public exploit code:

- Security-research lab: reproduction of CVE-2025-61584 (GHSA-9g7x-737f-5xpc) — command injection via github.head_ref in pull_request_target workflow (.github/workflows/pr.yml) (github_poc): https://github.com/pvharmo2/gha-lab-6904b2ccbe

## Fix prompt for AI coding agents

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

What it is: CVE-2025-61584 is a critical command injection vulnerability in serverless-dns, published on 30 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-61584 in the wild and no public exploit code.

Affected product: serverless-dns. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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