# GHSA-7v28-g2pq-ggg8: Ghost vulnerable to remote code execution in locale setting change

> Authenticated attackers can execute arbitrary commands via locale settings in Ghost, requiring an upgrade to patch.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jun 2022

## What is GHSA-7v28-g2pq-ggg8?

GHSA-7v28-g2pq-ggg8 is a command injection vulnerability in ghost, published on 17 Jun 2022. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

### Impact

A [vulnerability](https://www.cve.org/CVERecord?id=CVE-2022-24785) in an upstream library means an authenticated attacker can abuse locale input to execute arbitrary commands from a file that has previously been uploaded using the file upload functionality in the post editor.

### Patches

Fixed in 5.2.3, all 5.x sites should update as soon as possible.
Fixed in 4.48.2, all 4.x sites should update as soon as possible.

### Workarounds

Patched versions of Ghost add validation to the locale input to prevent execution of arbitrary files. Updating Ghost is the quickest complete solution.

As a workaround, if for any reason you cannot update your Ghost instance, you can block the `POST /ghost/api/admin/settings/` endpoint, which will also disable updating settings for your site.

### For more information

If you have any questions or comments about this advisory:
* Email us at [security@ghost.org](mailto:security@ghost.org)

### Credits

* devx00 - https://twitter.com/devx00

## Which versions are affected by GHSA-7v28-g2pq-ggg8?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ghost` | npm | All versions | 4.48.2 |
| `ghost` | npm | All versions | 4.48.2 |
| `ghost` | npm | From 5.0.0 | 5.2.3 |
| `ghost` | npm | From 5.0.0 | 5.2.3 |

## How do I fix GHSA-7v28-g2pq-ggg8?

Upgrade ghost to a fixed version for your release line: 4.48.2 or 5.2.3.

## Is GHSA-7v28-g2pq-ggg8 being exploited?

There is no known exploitation of GHSA-7v28-g2pq-ggg8 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7v28-g2pq-ggg8 and fix it if it is affected.

What it is: GHSA-7v28-g2pq-ggg8 is a command injection vulnerability in ghost, published on 17 Jun 2022. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-7v28-g2pq-ggg8 in the wild and no public exploit code.

Affected packages and fixed versions:
- ghost (npm): affected all versions; fixed in 4.48.2
- ghost (npm): affected all versions; fixed in 4.48.2
- ghost (npm): affected from 5.0.0; fixed in 5.2.3
- ghost (npm): affected from 5.0.0; fixed in 5.2.3

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-7v28-g2pq-ggg8/ (Markdown: https://insights.sbomify.com/GHSA-7v28-g2pq-ggg8/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7v28-g2pq-ggg8

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7v28-g2pq-ggg8/
Summaries are generated and may contain mistakes; the official description above is the record.
