CVE-2023-46240

7.5 HIGH

📋 TL;DR

CodeIgniter4 versions before 4.4.3 display detailed error reports in production environments when errors or exceptions occur, potentially leaking sensitive information like database credentials, file paths, or application logic. This affects all CodeIgniter4 applications running vulnerable versions in production mode. The vulnerability allows attackers to gain information about the application's internal structure.

💻 Affected Systems

Products:
  • CodeIgniter4
Versions: All versions before 4.4.3
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects production environment configurations. Development environments are expected to show detailed errors.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers obtain database credentials, API keys, or other sensitive configuration data, leading to full system compromise, data theft, or further attacks.

🟠

Likely Case

Attackers gather information about application structure, file paths, and potential weaknesses that could be used for targeted attacks.

🟢

If Mitigated

Limited information disclosure with no sensitive data exposed due to proper error handling configuration.

🌐 Internet-Facing: HIGH - Production web applications are typically internet-facing, making them directly accessible to attackers who can trigger errors.
🏢 Internal Only: MEDIUM - Internal applications could still leak sensitive information to authenticated but unauthorized users.

🎯 Exploit Status

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

Exploitation requires triggering an error or exception, which can often be done through malformed requests or accessing non-existent resources.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 4.4.3

Vendor Advisory: https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-hwxf-qxj7-7rfj

Restart Required: No

Instructions:

1. Update CodeIgniter4 to version 4.4.3 or later using composer: 'composer require codeigniter4/framework:^4.4.3' 2. Verify the update completed successfully 3. Test application functionality

🔧 Temporary Workarounds

Manual configuration fix

all

Modify the production configuration to properly disable error display

Edit app/Config/Boot/production.php and change 'ini_set('display_errors', '0')' to 'ini_set('display_errors', 'Off')'

🧯 If You Can't Patch

  • Implement custom error handling that catches all exceptions and returns generic error messages without sensitive details
  • Configure web server (Apache/Nginx) to intercept and rewrite error responses before they reach the client

🔍 How to Verify

Check if Vulnerable:

Check CodeIgniter version in composer.json or run 'composer show codeigniter4/framework' and verify version is below 4.4.3

Check Version:

composer show codeigniter4/framework | grep versions

Verify Fix Applied:

After patching, verify version is 4.4.3 or higher and test that production errors return generic messages without sensitive information

📡 Detection & Monitoring

Log Indicators:

  • HTTP 500 errors with detailed stack traces in access logs
  • Unusual error patterns or increased error rates

Network Indicators:

  • HTTP responses containing PHP error messages, stack traces, or file paths

SIEM Query:

http.status_code=500 AND (http.response_body="*PHP*" OR http.response_body="*Stack trace*")

🔗 References

📤 Share & Export