CVE-2025-8848

5.4 MEDIUM

📋 TL;DR

This vulnerability allows HTML injection via crafted Accept-Language headers in librechat version 0.7.9. When exploited, attackers can inject arbitrary HTML into the <html lang=""> tag, potentially enabling cross-site scripting (XSS) attacks. All users running the vulnerable version are affected.

💻 Affected Systems

Products:
  • danny-avila/librechat
Versions: 0.7.9
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires user authentication; only affects logged-in users sending HTTP GET requests.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full XSS exploitation leading to session hijacking, credential theft, or complete account compromise through malicious script execution in victim browsers.

🟠

Likely Case

Limited XSS attacks that could steal session cookies or perform actions on behalf of authenticated users.

🟢

If Mitigated

Minimal impact with proper input validation and output encoding preventing HTML injection.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authenticated user access and specific header manipulation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.7.10 or later

Vendor Advisory: https://huntr.com/bounties/a05ebc1f-882a-4adc-b178-d3cefa4b730e

Restart Required: No

Instructions:

1. Update librechat to version 0.7.10 or later. 2. Verify the update by checking the package version. 3. No restart required for typical deployments.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement server-side validation to sanitize Accept-Language header values before processing.

Implement regex filter: /^[a-zA-Z\-_,;=.*\s]+$/ for Accept-Language headers

🧯 If You Can't Patch

  • Implement WAF rules to block malicious Accept-Language header patterns.
  • Disable or restrict user access to vulnerable endpoints until patched.

🔍 How to Verify

Check if Vulnerable:

Check if running librechat version 0.7.9 and test with crafted Accept-Language header containing HTML payload.

Check Version:

npm list librechat or check package.json for version

Verify Fix Applied:

After updating, test with same payload; HTML should be properly encoded or rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Accept-Language header patterns containing HTML tags or script elements in HTTP logs.

Network Indicators:

  • HTTP requests with Accept-Language headers containing suspicious characters like <, >, or script tags.

SIEM Query:

source="web_logs" AND http_header="Accept-Language" AND (http_header CONTAINS "<" OR http_header CONTAINS ">" OR http_header CONTAINS "script")

🔗 References

📤 Share & Export