Free and open · new CVEs checked every 20 minutesStatusRSSOpen dataContact

CVE-2021-45040: The Spatie media-library-pro library through 1.17.10 and 2.x through 2.1.6 for Laravel allows remote attackers

66
This week
CRITICAL 9.8REMOTEUPGRADE

CVE-2021-45040 is a critical-severity flaw (CVSS 9.8) affecting laravel media library. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.

The Spatie media-library-pro library through 1.17.10 and 2.x through 2.1.6 for Laravel allows remote attackers to upload executable files via the uploads route.

Why this priority

  • Critical severity
  • Public exploit reference
  • Remotely exploitable, no login, no user action

A fixed release or distro patch exists.

Risk facts

CVSS score9.8 (Critical)
Attack vectorNetwork (remote)
Attack complexityLow
Privileges neededNone
User interactionNone
EPSS exploit chance3.2% (top 12%)
CISA exploited listNo
WeaknessCWE-434
Published2022-03-17
Last modified2026-06-17
Publisher (CNA): MITRE · Vendor: spatie

Share: LinkedIn · X · Reddit

Last updated 2026-06-17 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score

Am I affected?

Timeline

spatie laravel media library UPGRADE
Affected: <= 1.17.10 · >= 2.0.0 and <= 2.1.6
Fixed in: newer than 2.1.6
Safe to downgrade to: a release before 2.0.0
1. Check installed version
apt-cache policy laravel-media-library || rpm -q laravel-media-library || laravel-media-library --version
2. UPGRADE to newer than 2.1.6 (Debian / Ubuntu)
sudo apt update && sudo apt install --only-upgrade laravel-media-library
2. UPGRADE (RHEL / Amazon Linux / Fedora)
sudo dnf upgrade laravel-media-library
Note
Distros often backport fixes without changing the version number. Confirm with the distro advisory or changelog.
3. If no update is available yet, DOWNGRADE to a release before 2.0.0 (Debian / Ubuntu)
apt-cache madison laravel-media-library sudo apt install laravel-media-library=<VERSION_BEFORE_2.0.0> sudo apt-mark hold laravel-media-library
3. If no update is available yet, DOWNGRADE (RHEL / Amazon Linux / Fedora)
dnf --showduplicates list laravel-media-library sudo dnf downgrade laravel-media-library-<VERSION_BEFORE_2.0.0> sudo dnf versionlock add laravel-media-library
Downgrade risk
Downgrading can break dependent software and may reopen older bugs. Read the distro advisory first and test on a non-production host.
After downgrade
Restart the service, and keep the package held until a fixed release ships.
Verify at the official source NVD · CVE Program · Report a problem with this page
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.

Quick answers

How do I fix CVE-2021-45040?

laravel media library: upgrade to newer than 2.1.6. Exact commands for each OS are on this page.

Is CVE-2021-45040 being exploited?

CVE-2021-45040 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.

What does CVE-2021-45040 affect?

CVE-2021-45040 affects laravel media library. Severity is critical (CVSS 9.8). The Spatie media-library-pro library through 1.17.10 and 2.x through 2.1.6 for Laravel allows remote attackers to upload executable files via the uploads route.

How urgent is CVE-2021-45040?

Priority 66/100. Critical severity; Public exploit reference; Remotely exploitable, no login, no user action

Software pages

Laravel vulnerabilities

References

← Back to latest CVEs

Get the weekly exploited-CVE digest by emailThe CVEs being attacked this week and how to fix them. No spam, unsubscribe any time.