CVE-2020-24940

7.5 HIGH

📋 TL;DR

This vulnerability in Laravel allows attackers to bypass mass assignment protection by manipulating table names in database queries, potentially saving unvalidated data to the database. It affects Laravel applications using mass assignment features without proper validation. Developers using affected Laravel versions are at risk.

💻 Affected Systems

Products:
  • Laravel
Versions: Laravel < 6.18.34, Laravel 7.x < 7.23.2
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using mass assignment features. Applications not using mass assignment or using proper validation may not be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could inject malicious data into database tables, potentially leading to data corruption, privilege escalation, or remote code execution depending on application logic.

🟠

Likely Case

Data integrity compromise where attackers can modify database records they shouldn't have access to, potentially altering application behavior or user data.

🟢

If Mitigated

Limited impact if proper input validation and authorization checks are implemented at application layer beyond Laravel's mass assignment protection.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires understanding of Laravel's mass assignment feature and application-specific table structures. Attackers need some level of access to submit data.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Laravel 6.18.34, Laravel 7.23.2

Vendor Advisory: https://blog.laravel.com/security-release-laravel-61834-7232

Restart Required: No

Instructions:

1. Update Laravel via Composer: 'composer update laravel/framework'. 2. Verify version with 'php artisan --version'. 3. Test application functionality after update.

🔧 Temporary Workarounds

Implement explicit validation

all

Add explicit validation rules for all mass-assigned fields to prevent unvalidated data from being saved

Disable mass assignment

all

Remove mass assignment from vulnerable models by using $guarded property or explicit fillable arrays

🧯 If You Can't Patch

  • Implement strict input validation for all user-controlled data before database operations
  • Add application-level authorization checks to verify users have permission to modify specific database tables

🔍 How to Verify

Check if Vulnerable:

Check Laravel version in composer.json or run 'php artisan --version'. If version is <6.18.34 or 7.x <7.23.2, application is vulnerable if using mass assignment.

Check Version:

php artisan --version

Verify Fix Applied:

After updating, verify version is >=6.18.34 or >=7.23.2. Test mass assignment functionality with edge cases.

📡 Detection & Monitoring

Log Indicators:

  • Unusual database queries with unexpected table names
  • Mass assignment operations with suspicious parameters
  • Errors related to database column mismatches

Network Indicators:

  • HTTP requests with unexpected parameter names matching database table structures

SIEM Query:

web_requests WHERE parameters CONTAINS database_table_names AND response_code = 200

🔗 References

📤 Share & Export