CVE-2025-58758: TinyEnv: Missing .env file not required — may cause unexpected behavior
5.1
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| datahihi1/tiny-env | composer | < 1.0.3 | 1.0.3 |
| datahihi1/tiny-env | composer | >= 1.0.9, < 1.0.11 | 1.0.11 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the fact that the tiny-env library did not enforce the existence of a .env file. This could lead to applications running with default, and potentially insecure, configurations if the .env file was missing. The analysis of the patch commit 7dc656c58bef6050afb8f7a395e38227e31a66df clearly shows the fix. The loadInternal function in src/TinyEnv.php was modified to track whether a .env file was found and to throw an exception if one was not. The public load function is the entry point for this process, which in turn calls loadInternal. Therefore, both Datahihi1\TinyEnv\TinyEnv::load and Datahihi1\TinyEnv\TinyEnv::loadInternal are identified as the key functions related to this vulnerability. During exploitation (i.e., running the application without a .env file), these functions would be present in the stack trace, making them the primary runtime indicators.
Vulnerable functions
Datahihi1\TinyEnv\TinyEnv::loadsrc/TinyEnv.php
Datahihi1\TinyEnv\TinyEnv::loadInternalsrc/TinyEnv.php