CVE-2026-48557: Spatie/laravel medialibrary Spatie Laravel Media Library Contains Vulnerability

HIGH
Advisory Identifier: GHSA-3ggm-c5m7-hfv5
CVSS 8.8
CWE-184
Published
Advisory Summary

CVE-2026-48557 is a HIGH (CVSS 8.8) spatie laravel media library contains vulnerability (CWE-184: Incomplete List of Disallowed Inputs) affecting Spatie/laravel medialibrary libraries in the Packagist ecosystem. The issue involves spatie laravel media library contains a file upload restriction bypass. Remediation is available by upgrading affected packages to version 11.23.0.

CVE-2026-48557 at a Glance

CVE Identifier CVE-2026-48557
GHSA Identifier GHSA-3ggm-c5m7-hfv5
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-184: Incomplete List of Disallowed Inputs
Affected Product Spatie/laravel medialibrary
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-48557

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

spatie/laravel-medialibrary fixed: 11.23.0
Upgrade spatie/laravel-medialibrary to 11.23.0
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 spatie/laravel-medialibrary

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48557, inspect your project dependencies for Spatie/laravel medialibrary:

inspect dependencies for spatie/laravel-medialibrary

Analyze the terminal output to locate any version of Spatie/laravel medialibrary in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.23.0), 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-184: Incomplete List of Disallowed Inputs, where the product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete. In Spatie/laravel medialibrary, 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

Spatie Laravel Media Library before version 11.23.0 contains a file upload restriction bypass in FileAdder::defaultSanitizer(). The sanitizer checks only the final filename suffix, allowing double-extension filenames such as shell.php.jpg to bypass the blocklist, with pathinfo() preserving inner .php stems in saved filenames. The blocklist also omits executable extensions including .php6, .shtml, and .htaccess. The double-extension bypass requires a legacy Apache AddHandler configuration to achieve PHP execution; the incomplete blocklist bypass does not.

CVE-2026-48557 Affected Spatie/laravel medialibrary Versions

1 component(s)
Fixed Versions:
11.23.0
Product / Package Ecosystem Affected Versions Fixed Version
spatie/laravel-medialibrary
Packagist
< 11.23.0
11.23.0

References

Frequently Asked Questions

What is CVE-2026-48557?
CVE-2026-48557 is a security vulnerability in Spatie/laravel medialibrary involving Spatie Laravel Media Library contains a file upload restriction bypass under CWE-184: Incomplete List of Disallowed Inputs.
Which Spatie/laravel medialibrary versions are affected?
Affected versions include releases prior to 11.23.0 across affected packages: spatie/laravel-medialibrary.
What version fixes CVE-2026-48557?
Upgrading to 11.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spatie/laravel-medialibrary affected?
Yes, spatie/laravel-medialibrary is affected in releases prior to 11.23.0. Upgrade your dependency to 11.23.0 or later.
What is the CVSS score of CVE-2026-48557?
CVE-2026-48557 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-48557?
CVE-2026-48557 is classified under CWE-184: Incomplete List of Disallowed Inputs (The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete.).
How can I check Packagist dependencies for CVE-2026-48557?
Run the dependency tree command: 'inspect dependencies for spatie/laravel-medialibrary'. 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-3ggm-c5m7-hfv5",
  "modified" : "2026-07-02T21:02:07Z",
  "published" : "2026-05-29T21:31:25Z",
  "aliases" : [ "CVE-2026-48557" ],
  "summary" : "Spatie Laravel Media Library contains a file upload restriction bypass",
  "details" : "Spatie Laravel Media Library before version 11.23.0 contains a file upload restriction bypass in FileAdder::defaultSanitizer(). The sanitizer checks only the final filename suffix, allowing double-extension filenames such as shell.php.jpg to bypass the blocklist, with pathinfo() preserving inner .php stems in saved filenames. The blocklist also omits executable extensions including .php6, .shtml, and .htaccess. The double-extension bypass requires a legacy Apache AddHandler configuration to achieve PHP execution; the incomplete blocklist bypass does not.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "spatie/laravel-medialibrary"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-48557"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spatie/laravel-medialibrary/pull/3939"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spatie/laravel-medialibrary/commit/608ea03703d3887c46434f5dda6af56de6346aba"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spatie/laravel-medialibrary"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spatie/laravel-medialibrary/releases/tag/11.23.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/spatie-laravel-media-library-file-upload-restriction-bypass-via-fileadder-php"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-184" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T21:02:07Z",
    "nvd_published_at" : "2026-05-29T20:16:28Z"
  }
}