CVE-2009-5054: Smarty Does Not Consider Umask Values When Setting Permissions

smarty/smarty Updated 02 Oct 2025

Summary

02/05/2022
Yes i
Moderate
Not published

CVE-2009-5054: Smarty Does Not Consider Umask Values When Setting Permissions. Affects smarty/smarty versions < 3.0.0-beta4. Fixed in 3.0.0-beta4. How to fix ↓

Also tracked for

The same CVE-2009-5054 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Smarty is a popular template engine used in web development. It provides a way to separate the presentation logic from the application logic, making it easier to maintain and update the user interface. Smarty allows developers to create templates with placeholders for dynamic content, which are then filled in with data from the application. This vulnerability in Smarty versions before 3.0.0 beta 4 allows attackers to bypass access restrictions by manipulating file permissions. The umask value, which determines the default permissions for newly created files, is not taken into consideration when setting permissions in Smarty. This oversight can be exploited through standard filesystem operations, potentially granting unauthorized access to sensitive files.

Vulnerability Detail

The vulnerability arises from the fact that Smarty does not consider the umask value when setting file permissions. By default, the umask value is used to determine the permissions for new files created by a process. However, Smarty fails to account for this, resulting in incorrect permissions being set for files it creates. This can be exploited by an attacker who has access to the filesystem and can perform standard operations like creating or modifying files. By manipulating the umask value or using existing permissions, the attacker can bypass intended access restrictions and gain unauthorized access to files. This vulnerability has a moderate severity rating and is identified by the CVE identifier CVE-2009-5054.

How To Fix

Minimum fixed version

3.0.0-beta4

This is the first release that contains the fix.

composer require smarty/smarty:3.0.0-beta4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version of Smarty is not immediately feasible, a workaround can be implemented by manually adjusting the file permissions after Smarty creates or modifies files. This can be done by explicitly setting the desired permissions using chmod or similar tools. However, this workaround is not recommended as it requires manual intervention and may introduce human error. It is strongly advised to upgrade to the latest version of Smarty as soon as possible.

Conclusion

In conclusion, the vulnerability in Smarty versions before 3.0.0 beta 4 allows attackers to bypass access restrictions by manipulating file permissions. Upgrading to the latest version of Smarty or applying the recommended workaround will help mitigate the risk of unauthorized access to sensitive files. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for smarty/smarty →

Share this vulnerability

FAQ

Smarty is a template engine used in web development to separate the presentation logic from the application logic. It allows developers to create templates with placeholders for dynamic content.

The umask value is a bitmask that determines the default permissions for newly created files. It is used by the operating system to restrict the permissions that are automatically set for new files.

An attacker with access to the filesystem can exploit this vulnerability by manipulating the umask value or using existing permissions to bypass intended access restrictions and gain unauthorized access to files created or modified by Smarty.

This vulnerability has a moderate severity rating. While it can potentially allow unauthorized access to sensitive files, it requires the attacker to have access to the filesystem and perform standard operations.

To fix this vulnerability, it is recommended to upgrade to Smarty version 3.0.0 beta 4 or later. This version includes a fix for the umask issue, ensuring that file permissions are set correctly according to the umask value.

Related vulnerabilities

Recent vulnerabilities recorded for smarty/smarty.

How To Fix

Minimum fixed version

3.0.0-beta4

This is the first release that contains the fix.

composer require smarty/smarty:3.0.0-beta4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback