# CVE-2025-58759: TinyEnv: Inline comments not stripped properly in .env values

> Improper stripping of inline comments in .env files can cause misconfigurations, potentially leading to authentication failures or insecure defaults in PHP applications.

- **Severity:** Medium 5.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Sep 2025
- **Updated:** 10 Sep 2025
- **Also known as:** GHSA-72cm-7236-h43r

## What is CVE-2025-58759?

CVE-2025-58759 is a medium-severity vulnerability in datahihi1 tiny-env, published on 9 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

TinyEnv is an environment variable loader for PHP applications. In versions 1.0.9 and 1.0.10, TinyEnv did not properly strip inline comments inside .env values. This could lead to unexpected behavior or misconfiguration, where variables contain unintended characters (including # or comment text). Applications depending on strict environment values may expose logic errors, insecure defaults, or failed authentication. The issue is fixed in v1.0.11. Users should upgrade to the latest patched version. As a temporary workaround, avoid using inline comments in .env files, or sanitize loaded values manually.

Weakness: CWE-20 (Improper Input Validation)

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

2 open source packages ship an affected version, including datahihi1/tiny-env. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `datahihi1/tiny-env` | Packagist | From 1.0.9 | 1.0.11 |
| `datahihi1/tiny-env` | Packagist | From 1.0.9 | 1.0.11 |

Products: Datahihi1 Tinyenv.

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

Upgrade datahihi1/tiny-env to 1.0.11 or later.

## Is CVE-2025-58759 being exploited?

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

## Other vulnerabilities in datahihi1 tiny-env

- [CVE-2025-58758](https://insights.sbomify.com/CVE-2025-58758/): TinyEnv: Missing .env file not required — may cause unexpected behavior (medium 5.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-58759 is a medium-severity vulnerability in datahihi1 tiny-env, published on 9 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-58759 in the wild and no public exploit code.

Affected packages and fixed versions:
- datahihi1/tiny-env (Packagist): affected from 1.0.9; fixed in 1.0.11
- datahihi1/tiny-env (Packagist): affected from 1.0.9; fixed in 1.0.11

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

## Sources

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

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