# GHSA-wfrj-qqc2-83cm: Remote command injection when using sendmail email transport

> Remote attackers can execute arbitrary commands on Ghost sites configured to use the sendmail email transport.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Sep 2021

## What is GHSA-wfrj-qqc2-83cm?

GHSA-wfrj-qqc2-83cm is a command injection vulnerability in ghost, published on 20 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact

Sites using the `sendmail` transport as part of their `mail` config are vulnerable to remote command injection due to a [vulnerability](https://github.com/advisories/GHSA-48ww-j4fc-435p) in the `nodemailer` dependency.

Ghost defaults to the `direct` transport so this is only exploitable if the `sendmail` transport is explicitly used.

### Patches

Fixed in 4.15.0, all sites should upgrade as soon as possible.

### Workarounds

* Use an alternative email transport as described in the [docs](https://ghost.org/docs/config/#mail). 

### For more information

If you have any questions or comments about this advisory:

* email us at security@ghost.org

## Which versions are affected by GHSA-wfrj-qqc2-83cm?

2 open source packages ship an affected version, including ghost.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ghost` | npm | All versions | 4.15.0 |
| `ghost` | npm | All versions | 4.15.0 |

## How do I fix GHSA-wfrj-qqc2-83cm?

Upgrade ghost to 4.15.0 or later.

## Is GHSA-wfrj-qqc2-83cm being exploited?

There is no known exploitation of GHSA-wfrj-qqc2-83cm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-wfrj-qqc2-83cm and fix it if it is affected.

What it is: GHSA-wfrj-qqc2-83cm is a command injection vulnerability in ghost, published on 20 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-wfrj-qqc2-83cm in the wild and no public exploit code.

Affected packages and fixed versions:
- ghost (npm): affected all versions; fixed in 4.15.0
- ghost (npm): affected all versions; fixed in 4.15.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/GHSA-wfrj-qqc2-83cm/ (Markdown: https://insights.sbomify.com/GHSA-wfrj-qqc2-83cm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-wfrj-qqc2-83cm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-wfrj-qqc2-83cm/
Summaries are generated and may contain mistakes; the official description above is the record.
