Skip to content

Stored Cross-Site Scripting in Sessions allows a non-privileged user to gain admin permissions when an admin views the session page

High
advplyr published GHSA-qr9h-3q76-7gj8 Apr 2, 2026

Package

audiobookshelf (audiobookshelf)

Affected versions

< v2.33.0

Patched versions

>= v2.33.0

Description

Summary

A session can be created by any signed-in user without extra permissions (Privileges Required: Low). If an attacker injects a malicious client name, it can trigger XSS when an admin visits the Listening Session view (/audiobookshelf/config/sessions/). Since this view is likely to be visited, the chance that the injection will run is high. This can be used to extract tokens or user objects.

As a user that can visit this page always is admin or higher this gives the attacker an admin account to inject with a 100% success rate, once the injection runs.

Details

This works at least in the session view (/audiobookshelf/config/sessions/) and the user view (/audiobookshelf/config/users/<>/sessions).

Note

It was also found that if a user was issued an API token but was later disabled, the API token is still valid and can still be used to create a session. Since issuing an API token is an admin task, this is out of scope for this report, but it should be noted that this behavior exists. This means that even disabled users with a non-expired API key can escalate privileges and even re-enable themselves this way.

This also affects "guest" user types.

PoC


curl --request POST \
  --url http://localhost:13378/api/session/local \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'User-Agent: insomnia/12.3.1' \
  --data '{
    "id": "a1b2c3d4-e5f6-7890-1234-abcdef123456", 
    "libraryItemId": "7db4b874-2670-41aa-aa29-173d4d8cd41c",
    "episodeId": "bce79130-58a8-4ce1-a9f9-617ce3ee0028",
    "mediaType": "podcast",
    "currentTime": 120.50,
    "timeListening": 3600.00,
    "duration": 2119.02,
    "startedAt": 1709827000000, 
    "updatedAt": 1709830600000, 
    "deviceInfo": {
      "deviceId": "abc",
      "clientName": "<img src=\"x\" onerror=\"alert(JSON.stringify(Object.fromEntries(Object.entries(localStorage))))\">"
    }
  }'
image image

Impact

This gives every user of an ABS server a realistic chance of a complete takeover. A user could also send an admin a valid and harmless-looking link to the session screen (which indeed is just completely normal), which could trigger this. If done well, it should be possible to keep it fully invisible to the user attacked.
This impacts confidentiality, and also integrity and availability, since the attacker effectively gains a privilege escalation at that point.

Affected areas

<p class="text-xs truncate" v-html="getDeviceInfoString(session.deviceInfo)" />

<p class="text-xs truncate" v-html="getDeviceInfoString(session.deviceInfo)" />

<p class="text-xs truncate" v-html="getDeviceInfoString(session.deviceInfo)" />

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

No CWEs

Credits