GHSA-p9fg-j6ww-953m: Friendsofsymfony/rest bundle FOSRestBundle Issue With Broken Validation Vulnerability

MODERATE
Published
Advisory Summary

GHSA-p9fg-j6ww-953m is a MODERATE fosrestbundle issue with broken validation vulnerability (General Security Weakness) affecting Friendsofsymfony/rest bundle libraries in the Packagist ecosystem. The issue involves fosrestbundle issue with broken validation of jsonp callbacks. Remediation is available by upgrading affected packages to version 1.2.2.

GHSA-p9fg-j6ww-953m at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-p9fg-j6ww-953m
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Friendsofsymfony/rest bundle
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-p9fg-j6ww-953m

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

friendsofsymfony/rest-bundle fixed: 1.2.2
Upgrade friendsofsymfony/rest-bundle to 1.2.2
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 friendsofsymfony/rest-bundle

How to Check if You Are Affected

To determine whether your application is affected by GHSA-p9fg-j6ww-953m, inspect your project dependencies for Friendsofsymfony/rest bundle:

inspect dependencies for friendsofsymfony/rest-bundle

Analyze the terminal output to locate any version of Friendsofsymfony/rest bundle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.2), 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 General Security Weakness. In Friendsofsymfony/rest bundle, 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

Starting with FOSRestBundle 1.2 we [switched](https://github.com/FriendsOfSymfony/FOSRestBundle/pull/642/files#diff-431bc57ca9ca16332c0cff43ad45263cR37) to using [willdurand/jsonp-callback-validator](https://github.com/willdurand/JsonpCallbackValidator) for validation of JSONP callbacks. However [the change was implemented](https://github.com/FriendsOfSymfony/FOSRestBundle/pull/665) incorrectly validating the callback query param name, rather than its value. Anyone using the JSONP handler (which is off by default) together with FOSRestBundle 1.2.0 or 1.2.1 should update to FOSRestBundle [1.2.2](https://github.com/FriendsOfSymfony/FOSRestBundle/releases/tag/1.2.2).

GHSA-p9fg-j6ww-953m Affected Friendsofsymfony/rest bundle Versions

1 component(s)
Fixed Versions:
1.2.2
Product / Package Ecosystem Affected Versions Fixed Version
friendsofsymfony/rest-bundle
Packagist
≥ 1.2.0
< 1.2.2
1.2.2

References

Frequently Asked Questions

What is GHSA-p9fg-j6ww-953m?
GHSA-p9fg-j6ww-953m is a security vulnerability in Friendsofsymfony/rest bundle involving FOSRestBundle issue with broken validation of JSONP callbacks under General Security Weakness.
Which Friendsofsymfony/rest bundle versions are affected?
Affected versions include releases prior to 1.2.2 across affected packages: friendsofsymfony/rest-bundle.
What version fixes GHSA-p9fg-j6ww-953m?
Upgrading to 1.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is friendsofsymfony/rest-bundle affected?
Yes, friendsofsymfony/rest-bundle is affected in releases prior to 1.2.2. Upgrade your dependency to 1.2.2 or later.
What CWE is associated with GHSA-p9fg-j6ww-953m?
GHSA-p9fg-j6ww-953m is classified under General Security Weakness.
How can I check Packagist dependencies for GHSA-p9fg-j6ww-953m?
Run the dependency tree command: 'inspect dependencies for friendsofsymfony/rest-bundle'. 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-p9fg-j6ww-953m",
  "modified" : "2024-05-15T21:41:09Z",
  "published" : "2024-05-15T21:41:09Z",
  "aliases" : [ ],
  "summary" : "FOSRestBundle issue with broken validation of JSONP callbacks",
  "details" : "Starting with FOSRestBundle 1.2 we [switched](https://github.com/FriendsOfSymfony/FOSRestBundle/pull/642/files#diff-431bc57ca9ca16332c0cff43ad45263cR37) to using [willdurand/jsonp-callback-validator](https://github.com/willdurand/JsonpCallbackValidator) for validation of JSONP callbacks. However [the change was implemented](https://github.com/FriendsOfSymfony/FOSRestBundle/pull/665) incorrectly validating the callback query param name, rather than its value. Anyone using the JSONP handler (which is off by default) together with FOSRestBundle 1.2.0 or 1.2.1 should update to FOSRestBundle [1.2.2](https://github.com/FriendsOfSymfony/FOSRestBundle/releases/tag/1.2.2).",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "friendsofsymfony/rest-bundle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.2.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfSymfony/FOSRestBundle/commit/3dd7d40068360c23366fb4884c5d194c769ec2c1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/friendsofsymfony/rest-bundle/2014-01-22-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/FriendsOfSymfony/FOSRestBundle"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/blog/fosrestbundle-security-issue-with-jsonp-handler"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T21:41:09Z",
    "nvd_published_at" : null
  }
}