# CVE-2025-58758: TinyEnv: Missing .env file not required — may cause unexpected behavior


- **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
- **Fix available:** Yes
- **Published:** 9 Sep 2025
- **Updated:** 10 Sep 2025
- **Also known as:** GHSA-3j7m-5g4q-gfpc

## What is CVE-2025-58758?

CVE-2025-58758 is a medium-severity vulnerability in datahihi1 tiny-env, published on 9 Sep 2025. 

### Official description

TinyEnv is an environment variable loader for PHP applications. In versions 1.0.1, 1.0.2, 1.0.9, and 1.0.10, TinyEnv did not require the `.env` file to exist when loading environment variables. This could lead to unexpected behavior where the application silently ignores missing configuration, potentially causing insecure defaults or deployment misconfigurations. The issue has been fixed in version 1.0.11. All users should upgrade to 1.0.11 or later. As a workaround, users can manually verify the existence of the `.env` file before initializing TinyEnv.

Weakness: CWE-703 (Improper Check or Handling of Exceptional Conditions)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `datahihi1/tiny-env` | Packagist | All versions | 1.0.3 |
| `datahihi1/tiny-env` | Packagist | All versions | 1.0.3 |
| `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-58758?

Upgrade datahihi1/tiny-env to a fixed version for your release line: 1.0.3 or 1.0.11.

## Is CVE-2025-58758 being exploited?

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

## Other vulnerabilities in datahihi1 tiny-env

- [CVE-2025-58759](https://insights.sbomify.com/CVE-2025-58759/): TinyEnv: Inline comments not stripped properly in .env values (medium 5.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-58758 is a medium-severity vulnerability in datahihi1 tiny-env, published on 9 Sep 2025. 
Exploitation: There is no known exploitation of CVE-2025-58758 in the wild and no public exploit code.

Affected packages and fixed versions:
- datahihi1/tiny-env (Packagist): affected all versions; fixed in 1.0.3
- datahihi1/tiny-env (Packagist): affected all versions; fixed in 1.0.3
- 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-58758/ (Markdown: https://insights.sbomify.com/CVE-2025-58758/index.md)
```

## Sources

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

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