# GHSA-q95h-cqrv-8jv5: ExifTool vulnerable to arbitrary code execution

> Attackers can execute arbitrary code by tricking users into processing malicious image files with the ExifTool Ruby library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 20 Jan 2023

## What is GHSA-q95h-cqrv-8jv5?

GHSA-q95h-cqrv-8jv5 is a code injection vulnerability in exiftool_vendored, published on 20 Jan 2023. 

### Official description

### Impact
Arbitrary code execution can occur when running `exiftool` against files with hostile metadata payloads

### Patches
ExifTool has already been patched in version 12.24. `exiftool_vendored.rb`, which vendors ExifTool, includes this patch in [v12.25.0](https://github.com/exiftool-rb/exiftool_vendored.rb/releases/tag/v12.25.0).

### Workarounds
No

### References
https://twitter.com/wcbowling/status/1385803927321415687
https://nvd.nist.gov/vuln/detail/CVE-2021-22204

### For more information
If you have any questions or comments about this advisory:

Open an issue in [exiftool_vendored.rb](https://github.com/exiftool-rb/exiftool_vendored.rb/issues)

## Which versions are affected by GHSA-q95h-cqrv-8jv5?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `exiftool_vendored` | RubyGems | All versions | 12.25.0 |
| `exiftool_vendored` | RubyGems | All versions | 12.25.0 |

## How do I fix GHSA-q95h-cqrv-8jv5?

Upgrade exiftool_vendored to 12.25.0 or later.

## Is GHSA-q95h-cqrv-8jv5 being exploited?

There is no known exploitation of GHSA-q95h-cqrv-8jv5 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q95h-cqrv-8jv5 and fix it if it is affected.

What it is: GHSA-q95h-cqrv-8jv5 is a code injection vulnerability in exiftool_vendored, published on 20 Jan 2023. 
Exploitation: There is no known exploitation of GHSA-q95h-cqrv-8jv5 in the wild and no public exploit code.

Affected packages and fixed versions:
- exiftool_vendored (RubyGems): affected all versions; fixed in 12.25.0
- exiftool_vendored (RubyGems): affected all versions; fixed in 12.25.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-q95h-cqrv-8jv5/ (Markdown: https://insights.sbomify.com/GHSA-q95h-cqrv-8jv5/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q95h-cqrv-8jv5

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q95h-cqrv-8jv5/
Summaries are generated and may contain mistakes; the official description above is the record.
