CVE-2014-4931: Code Injection in Symfony FrameworkBundle Translation Caching

symfony/framework-bundle Updated 02 Oct 2025

Summary

30/05/2024
Yes i
High
7.5

CVE-2014-4931: Code injection in the way Symfony implements translation caching in FrameworkBundle. Affects symfony/framework-bundle across 3 version ranges.

>= 2.0.0, < 2.3.18 >= 2.4.0, < 2.4.8 >= 2.5.0, < 2.5.2

Fixed in 2.3.18, 2.4.8 or 2.5.2, depending on the release line you run. How to fix ↓

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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

Symfony FrameworkBundle is a component of the Symfony full-stack framework that provides a set of tools and libraries for building web applications. It includes the Symfony translation system, which allows developers to manage and translate messages in different languages. However, a vulnerability in the translation caching mechanism of FrameworkBundle allows for code injection, potentially leading to remote code execution.

Vulnerability Detail

The vulnerability arises when Symfony FrameworkBundle is used in conjunction with the translation system and unvalidated locales are accepted from a URL parameter. Attackers can exploit this by submitting a non-valid locale value that contains PHP code. This code is then executed by Symfony when generating a PHP file in the cache, without proper sanitization. As a result, an attacker can execute arbitrary code on the server.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.3.18 2.3.18
    composer require symfony/framework-bundle:2.3.18
  • >= 2.4.0, < 2.4.8 2.4.8
    composer require symfony/framework-bundle:2.4.8
  • >= 2.5.0, < 2.5.2 2.5.2
    composer require symfony/framework-bundle:2.5.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

A temporary workaround for this vulnerability is to manually sanitize and validate the locales received from the URL parameter before using them in the translation system. This can be done by implementing custom validation logic or using a library that provides input validation functions. Here is an example of how to sanitize the locale parameter in PHP:

$locale = $_GET['_locale'];
$allowedLocales = ['en', 'fr', 'de'];

if (!in_array($locale, $allowedLocales)) {
    // Handle invalid locale
}

Conclusion

The code injection vulnerability in Symfony FrameworkBundle's translation caching mechanism can lead to remote code execution. It is crucial to upgrade to the fixed versions of Symfony FrameworkBundle and implement proper input validation to mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for symfony/framework-bundle →

Share this vulnerability

FAQ

Symfony FrameworkBundle is a component of the Symfony full-stack framework that provides a set of tools and libraries for building web applications. It includes various features such as routing, templating, and the translation system.

The vulnerability occurs when unvalidated locales are accepted from a URL parameter. Attackers can submit a non-valid locale value containing PHP code, which is then executed by Symfony when generating a PHP file in the cache. This allows for arbitrary code execution.

The vulnerability can lead to remote code execution, allowing attackers to execute arbitrary code on the server. This can result in unauthorized access, data breaches, and further compromise of the affected system.

To fix the vulnerability, it is recommended to upgrade to a fixed version of Symfony FrameworkBundle. Refer to the 'how_to_fix' section for the specific versions that address the issue. Additionally, ensure that all user-supplied input, such as locales, is properly sanitized and validated to prevent code injection attacks.

Yes, a temporary workaround is to manually sanitize and validate the locales received from the URL parameter before using them in the translation system. Refer to the 'workaround' section for an example of how to sanitize the locale parameter in PHP.

Related vulnerabilities

Recent vulnerabilities recorded for symfony/framework-bundle.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.3.18 2.3.18
    composer require symfony/framework-bundle:2.3.18
  • >= 2.4.0, < 2.4.8 2.4.8
    composer require symfony/framework-bundle:2.4.8
  • >= 2.5.0, < 2.5.2 2.5.2
    composer require symfony/framework-bundle:2.5.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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