CVE-2020-19316: OS Command Injection in Laravel Framework

laravel/framework Updated 02 Oct 2025

Summary

06/01/2022
Yes i
High
8.8

CVE-2020-19316: OS Command Injection in Laravel Framework. Affects laravel/framework versions < 5.8.17. Fixed in 5.8.17. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Laravel Framework is a popular PHP web application framework used for developing robust and scalable applications. It provides a wide range of features and tools to simplify the development process. However, versions prior to 5.8.17 are vulnerable to an OS command injection vulnerability in the 'link' function of the 'Filesystem.php' file. This vulnerability allows an attacker to execute arbitrary commands on the server, potentially leading to unauthorized access, data leakage, or remote code execution.

Vulnerability Detail

The OS command injection vulnerability in Laravel Framework arises due to insufficient input validation in the 'link' function of the 'Filesystem.php' file. An attacker can exploit this vulnerability by injecting malicious commands through user-controlled input, which are then executed by the server. This can be achieved by manipulating the input parameters passed to the 'link' function. The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary commands with the privileges of the web server user, potentially compromising the entire system.

How To Fix

Minimum fixed version

5.8.17

This is the first release that contains the fix.

composer require laravel/framework:5.8.17

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, developers can implement input validation and sanitization measures to mitigate the risk of OS command injection. This can be achieved by using appropriate validation functions and filters to ensure that user-controlled input does not contain any malicious commands. Additionally, it is recommended to restrict the execution of commands to a limited set of known safe commands or use whitelisting to only allow specific inputs.

Conclusion

The OS command injection vulnerability in Laravel Framework poses a significant risk to the security and integrity of web applications. It is crucial for developers to promptly upgrade to the latest version of Laravel Framework (5.8.17 or later) to mitigate this vulnerability. Additionally, implementing input validation and sanitization measures can provide temporary mitigation until the upgrade is performed. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for laravel/framework →

Share this vulnerability

FAQ

The OS command injection vulnerability in Laravel Framework allows an attacker to execute arbitrary commands on the server, potentially leading to unauthorized access, data leakage, or remote code execution.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your 'composer.lock' file and Vulert will analyze it for any open-source vulnerabilities, including this OS command injection vulnerability.

If upgrading to the latest version is not immediately feasible, you can implement input validation and sanitization measures to mitigate the risk of OS command injection. Ensure that user-controlled input is properly validated and sanitized to prevent the execution of malicious commands.

At the time of this advisory, there are no known public exploits specifically targeting this vulnerability in Laravel Framework. However, it is crucial to apply the recommended fixes and security patches to prevent any potential exploitation.

You can find more information about this vulnerability, including the technical details and the patch, in the GitHub Advisory Database (https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/01/GHSA-w2pm-r78h-4m7v/GHSA-w2pm-r78h-4m7v.json).

Related vulnerabilities

Recent vulnerabilities recorded for laravel/framework.

How To Fix

Minimum fixed version

5.8.17

This is the first release that contains the fix.

composer require laravel/framework:5.8.17

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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