CVE-2009-5054: Smarty/smarty Smarty Does Not Consider Umask Vulnerability

MODERATE
Advisory Identifier: GHSA-6m9f-8vwq-97pm
CWE-281
Published
Advisory Summary

CVE-2009-5054 is a MODERATE smarty does not consider umask vulnerability (CWE-281: Improper Preservation of Permissions) affecting Smarty/smarty libraries in the Packagist ecosystem. The issue involves smarty does not consider umask values when setting permissions. Remediation is available by upgrading affected packages to version 3.0.0-beta4.

CVE-2009-5054 at a Glance

CVE Identifier CVE-2009-5054
GHSA Identifier GHSA-6m9f-8vwq-97pm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-281: Improper Preservation of Permissions
Affected Product Smarty/smarty
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2009-5054

To remediate this vulnerability, upgrade all affected Smarty/smarty dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

smarty/smarty fixed: 3.0.0-beta4
Upgrade smarty/smarty to 3.0.0-beta4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for smarty/smarty

How to Check if You Are Affected

To determine whether your application is affected by CVE-2009-5054, inspect your project dependencies for Smarty/smarty:

inspect dependencies for smarty/smarty

Analyze the terminal output to locate any version of Smarty/smarty in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.0-beta4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-281: Improper Preservation of Permissions, where the product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended. In Smarty/smarty, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Smarty before 3.0.0 beta 4 does not consider the umask value when setting the permissions of files, which might allow attackers to bypass intended access restrictions via standard filesystem operations.

CVE-2009-5054 Affected Smarty/smarty Versions

1 component(s)
Fixed Versions:
3.0.0-beta4
Product / Package Ecosystem Affected Versions Fixed Version
smarty/smarty
Packagist
< 3.0.0-beta4
3.0.0-beta4

References

Frequently Asked Questions

What is CVE-2009-5054?
CVE-2009-5054 is a security vulnerability in Smarty/smarty involving Smarty Does Not Consider Umask Values When Setting Permissions under CWE-281: Improper Preservation of Permissions.
Which Smarty/smarty versions are affected?
Affected versions include releases prior to 3.0.0-beta4 across affected packages: smarty/smarty.
What version fixes CVE-2009-5054?
Upgrading to 3.0.0-beta4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is smarty/smarty affected?
Yes, smarty/smarty is affected in releases prior to 3.0.0-beta4. Upgrade your dependency to 3.0.0-beta4 or later.
What CWE is associated with CVE-2009-5054?
CVE-2009-5054 is classified under CWE-281: Improper Preservation of Permissions (The product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.).
How can I check Packagist dependencies for CVE-2009-5054?
Run the dependency tree command: 'inspect dependencies for smarty/smarty'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6m9f-8vwq-97pm",
  "modified" : "2024-02-08T22:08:36Z",
  "published" : "2022-05-02T04:00:47Z",
  "aliases" : [ "CVE-2009-5054" ],
  "summary" : "Smarty Does Not Consider Umask Values When Setting Permissions",
  "details" : "Smarty before 3.0.0 beta 4 does not consider the umask value when setting the permissions of files, which might allow attackers to bypass intended access restrictions via standard filesystem operations.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "smarty/smarty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.0-beta4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2009-5054"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/smarty-php/smarty"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20101116174040/http://smarty-php.googlecode.com/svn/trunk/distribution/change_log.txt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-281" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-08T22:08:36Z",
    "nvd_published_at" : "2011-02-03T17:00:00Z"
  }
}