CVE-2025-5138 Overview
CVE-2025-5138 is a cross-site scripting (XSS) vulnerability affecting Bitwarden up to version 2.25.1. The flaw resides in the PDF File Handler component, where the file upload functionality fails to properly sanitize embedded content. An authenticated attacker can craft a malicious PDF that triggers script execution when handled by the application. The issue is classified under [CWE-79] Improper Neutralization of Input During Web Page Generation. Public proof-of-concept material exists, but the vendor has not confirmed the issue and did not respond to disclosure attempts. The reality of the vulnerability remains disputed at the time of publication.
Critical Impact
Successful exploitation requires user interaction and authenticated access, and is limited to low-integrity impact within the affected client. No confidentiality or availability impact is reported.
Affected Products
- Bitwarden versions up to and including 2.25.1
- PDF File Handler component within the file upload function
- Deployments accepting user-uploaded PDF attachments
Discovery Timeline
- 2025-05-25 - CVE-2025-5138 published to NVD with public proof-of-concept disclosure
- 2026-04-29 - Last updated in NVD database
Technical Details for CVE-2025-5138
Vulnerability Analysis
The vulnerability exists in the way Bitwarden processes PDF files uploaded through its attachment functionality. PDFs support embedded JavaScript and active content through standard PDF specifications. When the application renders or previews a maliciously crafted PDF, attacker-controlled script content executes within the application's web context.
Exploitation requires the attacker to authenticate with at least low privileges and upload a crafted PDF file. A target user must then interact with the file for the payload to trigger. The impact is constrained to integrity within the rendering context, with no direct access to confidentiality or availability of the underlying vault data based on the reported vector.
The vendor has not acknowledged the report, and independent verification of the issue is limited. Practitioners should treat the report as unconfirmed pending vendor response.
Root Cause
The root cause is insufficient neutralization of active content within uploaded PDF documents [CWE-79]. The file handler does not sanitize or sandbox script-capable elements before rendering them in a context that can execute or interpret embedded markup.
Attack Vector
The attack is network-reachable but requires authentication and user interaction. An attacker uploads a PDF containing crafted active content as an item attachment. When another user views or downloads the attachment through the affected client, the embedded payload executes in the user's session context. The public proof-of-concept is documented in the GitHub PoC for Bitwarden XSS.
Detection Methods for CVE-2025-5138
Indicators of Compromise
- PDF attachments uploaded to Bitwarden vaults containing embedded JavaScript or /JS and /JavaScript action dictionaries
- Unexpected outbound network requests originating from the Bitwarden client after attachment interaction
- Attachment filenames or metadata containing script tags or unusual encoding patterns
Detection Strategies
- Inspect uploaded PDF files using static analysis tools to flag embedded JavaScript actions and OpenAction triggers
- Monitor Bitwarden audit logs for attachment upload events correlated with low-privilege accounts
- Apply browser content security policy reporting to surface inline script execution in rendered attachments
Monitoring Recommendations
- Centralize Bitwarden application and access logs for review of attachment-related events
- Alert on accounts that upload PDF attachments containing script-capable PDF objects
- Track user interaction events with attachments to correlate potential exploitation activity
How to Mitigate CVE-2025-5138
Immediate Actions Required
- Restrict who can upload attachments to shared vault items until the report is verified or patched
- Educate users to avoid opening PDF attachments from untrusted or unexpected sources within Bitwarden
- Review existing PDF attachments in shared collections for embedded JavaScript actions
Patch Information
No vendor patch has been published. The vendor did not respond to disclosure, and the existence of the vulnerability remains contested. Monitor official Bitwarden release notes and security advisories for updates beyond version 2.25.1.
Workarounds
- Disable or limit PDF preview functionality within client environments where feasible
- Pre-process PDF uploads through a sanitization gateway that strips JavaScript actions and active content
- Use enterprise policy controls to restrict attachment upload permissions to trusted roles
# Configuration example
# Strip active content from PDFs before storage using qpdf as a sanitization step
qpdf --linearize --object-streams=disable input.pdf sanitized.pdf
exiftool -overwrite_original -JavaScript= -OpenAction= sanitized.pdf
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


