Skip to content

Stored Cross-Site Scripting in Login Page Custom Message

Moderate
advplyr published GHSA-cx29-ghq2-9cm4 Apr 28, 2026

Package

audiobookshelf (audiobookshelf)

Affected versions

< v2.33.0

Patched versions

>= v2.33.0

Description

Summary

A stored cross-site scripting (XSS) vulnerability exists in the Login Page due to improper sanitization of the authLoginCustomMessage field of the /api/auth-settings endpoint. An attacker with administrative privileges can inject arbitrary HTML/JavaScript that will be rendered on the login page for all users.

While the attack requires user interaction, it enables malicious scripts to capture credentials entered into the login form. This could allow an attacker to collect plaintext usernames and passwords before they are transmitted to the server.

This issue was reproduced using the current Docker edge build based on commit:
e6d49a2 and was found in the current latest build

Details

The login page renders the custom login message without sanitizing user-controlled HTML:

<p v-if="loginCustomMessage" class="py-2 default-style mb-2" v-html="loginCustomMessage"></p>

Because the loginCustomMessage (authLoginCustomMessage from the endpoint) value originates from server configuration and is inserted into the page without escaping, it allows arbitrary HTML/JavaScript execution in the browser.

Although modifying this value requires administrative privileges, any administrator account (including a compromised one) could inject a malicious payload that executes whenever a user visits the login page. This would allow the attacker to intercept credentials entered by users, even if the attacker does not otherwise have direct access to the server or its stored password hashes.

Proof of Concept

Sending a crafted request to /api/auth-settings with a malicious authLoginCustomMessage causes the payload to be rendered for all users visiting the login page.

Example payload:

{
  "authLoginCustomMessage": "<img src=\"x\" onerror=\"alert('hi')\">"
}

After this configuration is saved, the injected code executes when the login page is loaded.

image

The following allows an attacker to log and potentially remotely send the credentials to an attacker controlled server.

{
  "authLoginCustomMessage": "<img src=\"x\" onerror=\"document.querySelector('form')?.addEventListener('submit',()=>{const u=document.querySelector('input[name=username]')?.value;const p=document.querySelector('input[name=password]')?.value;alert('Username: '+u+' Password: '+p);});\">"
}

Impact

This vulnerability affects the login page and therefore impacts any user who accesses the server while logged out. A malicious script could capture usernames and passwords entered into the login form, potentially leading to full account compromise for affected users.

Severity

Moderate

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
High
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

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:H/UI:R/S:U/C:H/I:N/A:N

CVE ID

CVE-2026-42887

Weaknesses

No CWEs

Credits