CVE-2013-1397: Symfony/symfony Symfony Arbitrary PHP Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-7w53-hfpw-rg3g
CWE-94
Published
Advisory Summary

CVE-2013-1397 is a HIGH symfony arbitrary php code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Symfony/symfony libraries in the Packagist ecosystem. The issue involves symfony arbitrary php code execution. Remediation is available by upgrading affected packages to version 2.2.0-BETA2, 2.0.22, 2.1.7.

CVE-2013-1397 at a Glance

CVE Identifier CVE-2013-1397
GHSA Identifier GHSA-7w53-hfpw-rg3g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Symfony/symfony
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2013-1397

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

symfony/symfony fixed: 2.2.0-BETA2
Upgrade symfony/symfony to 2.2.0-BETA2
symfony/symfony fixed: 2.0.22
Upgrade symfony/symfony to 2.0.22
symfony/symfony fixed: 2.1.7
Upgrade symfony/symfony to 2.1.7
symfony/yaml fixed: 2.0.22
Upgrade symfony/yaml to 2.0.22
symfony/yaml fixed: 2.1.7
Upgrade symfony/yaml to 2.1.7
symfony/yaml fixed: 2.2.0-BETA2
Upgrade symfony/yaml to 2.2.0-BETA2
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 symfony/symfony

How to Check if You Are Affected

To determine whether your application is affected by CVE-2013-1397, inspect your project dependencies for Symfony/symfony:

inspect dependencies for symfony/symfony

Analyze the terminal output to locate any version of Symfony/symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.0-BETA2), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Symfony/symfony, 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

Symfony 2.0.x before 2.0.22, 2.1.x before 2.1.7, and 2.2.x remote attackers to execute arbitrary PHP code via a serialized PHP object to the (1) Yaml::parse or (2) Yaml\Parser::parse function, a different vulnerability than CVE-2013-1348.

CVE-2013-1397 Affected Symfony/symfony Versions

6 component(s)
Fixed Versions:
2.2.0-BETA22.0.222.1.7
Product / Package Ecosystem Affected Versions Fixed Version
symfony/symfony
Packagist
≥ 2.2.0-BETA1
< 2.2.0-BETA2
2.2.0-BETA2
symfony/symfony
Packagist
≥ 2.0.0
< 2.0.22
2.0.22
symfony/symfony
Packagist
≥ 2.1.0
< 2.1.7
2.1.7
symfony/yaml
Packagist
≥ 2.0.0
< 2.0.22
2.0.22
symfony/yaml
Packagist
≥ 2.1.0
< 2.1.7
2.1.7
symfony/yaml
Packagist
≥ 2.2.0-BETA1
< 2.2.0-BETA2
2.2.0-BETA2

References

Frequently Asked Questions

What is CVE-2013-1397?
CVE-2013-1397 is a security vulnerability in Symfony/symfony involving Symfony Arbitrary PHP code Execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Symfony/symfony versions are affected?
Affected versions include releases prior to 2.2.0-BETA2, 2.0.22, 2.1.7 across affected packages: symfony/symfony, symfony/yaml.
What version fixes CVE-2013-1397?
Upgrading to 2.2.0-BETA2, 2.0.22, 2.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 2.2.0-BETA2, 2.0.22, 2.1.7. Upgrade your dependency to 2.2.0-BETA2, 2.0.22, 2.1.7 or later.
Is symfony/yaml affected?
Yes, symfony/yaml is affected in releases prior to 2.0.22, 2.1.7, 2.2.0-BETA2. Upgrade your dependency to 2.0.22, 2.1.7, 2.2.0-BETA2 or later.
What CWE is associated with CVE-2013-1397?
CVE-2013-1397 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Packagist dependencies for CVE-2013-1397?
Run the dependency tree command: 'inspect dependencies for symfony/symfony'. 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-7w53-hfpw-rg3g",
  "modified" : "2025-04-14T21:43:11Z",
  "published" : "2022-05-17T01:36:49Z",
  "aliases" : [ "CVE-2013-1397" ],
  "summary" : "Symfony Arbitrary PHP code Execution",
  "details" : "Symfony 2.0.x before 2.0.22, 2.1.x before 2.1.7, and 2.2.x remote attackers to execute arbitrary PHP code via a serialized PHP object to the (1) Yaml::parse or (2) Yaml\\Parser::parse function, a different vulnerability than CVE-2013-1348.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0-BETA1"
      }, {
        "fixed" : "2.2.0-BETA2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0-BETA1"
      }, {
        "fixed" : "2.2.0-BETA2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-1397"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/ba6e3159c0eeb3b6e21db32fce8fa2535cb3aa77"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/81551"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2013-1397.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/yaml/CVE-2013-1397.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/security-release-symfony-2-0-22-and-2-1-7-released"
  }, {
    "type" : "WEB",
    "url" : "http://symfony.com/blog/security-release-symfony-2-0-22-and-2-1-7-released"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-28T23:40:22Z",
    "nvd_published_at" : "2014-06-02T15:55:00Z"
  }
}