CVE-2009-5054: Smarty Does Not Consider Umask Values When Setting Permissions
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.23784%
CWE
Published
5/2/2022
Updated
2/8/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
-
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
smarty/smarty | composer | < 3.0.0-beta4 | 3.0.0-beta4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from Smarty's file creation process not accounting for the system umask. The writeFile function is responsible for writing template cache/compile files and historically used hardcoded 0666 permissions. Since PHP's chmod() operates in absolute mode (overriding umask), this would leave files with permissions of (0666 & ~umask) instead of properly restricting them via (default_permissions & umask). The patched version would subtract the umask from the desired permissions, which aligns with the vulnerability description and CWE-281's improper permission preservation context.