# CVE-2025-48069: ejson2env has insufficient input sanitization

> Insufficient output sanitization in ejson2env allows attackers to inject arbitrary commands via malicious secret values when output is executed.

- **Severity:** Medium 6.6 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 May 2025
- **Updated:** 21 May 2025
- **Also known as:** GHSA-2c47-m757-32g6, GO-2025-3702

## What is CVE-2025-48069?

CVE-2025-48069 is a medium-severity command injection vulnerability in Shopify ejson2env, published on 21 May 2025. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

ejson2env allows users to decrypt EJSON secrets and export them as environment variables. Prior to version 2.0.8, the `ejson2env` tool has a vulnerability related to how it writes to `stdout`. Specifically, the tool is intended to write an export statement for environment variables and their values. However, due to inadequate output sanitization, there is a potential risk where variable names or values may include malicious content, resulting in additional unintended commands being output to `stdout`. If this output is improperly utilized in further command execution, it could lead to command injection, allowing an attacker to execute arbitrary commands on the host system. Version 2.0.8 sanitizes output during decryption. Other mitigations involve avoiding use of `ejson2env` to decrypt untrusted user secrets and/or avoiding evaluating or executing the direct output from `ejson2env` without removing nonprintable characters.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

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

8 open source packages ship an affected version, including github.com/Shopify/ejson2env, github.com/Shopify/ejson2env/v2 and ejson2env.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/Shopify/ejson2env` | Go | All versions | None |
| `github.com/Shopify/ejson2env` | Go | All versions | None |
| `github.com/Shopify/ejson2env` | Go | All versions | None |
| `github.com/Shopify/ejson2env/v2` | Go | All versions | 2.0.8 |
| `github.com/Shopify/ejson2env/v2` | Go | All versions | 2.0.8 |
| `github.com/Shopify/ejson2env/v2` | Go | All versions | 2.0.8 |
| `ejson2env` | RubyGems | All versions | 2.0.8 |
| `ejson2env` | RubyGems | All versions | 2.0.8 |

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

Upgrade to a fixed version.

## Is CVE-2025-48069 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-48069 is a medium-severity command injection vulnerability in Shopify ejson2env, published on 21 May 2025. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-48069 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/Shopify/ejson2env (Go): affected all versions; no fix listed
- github.com/Shopify/ejson2env (Go): affected all versions; no fix listed
- github.com/Shopify/ejson2env (Go): affected all versions; no fix listed
- github.com/Shopify/ejson2env/v2 (Go): affected all versions; fixed in 2.0.8
- github.com/Shopify/ejson2env/v2 (Go): affected all versions; fixed in 2.0.8
- github.com/Shopify/ejson2env/v2 (Go): affected all versions; fixed in 2.0.8
- ejson2env (RubyGems): affected all versions; fixed in 2.0.8
- ejson2env (RubyGems): affected all versions; fixed in 2.0.8

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

## Sources

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

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