Summary
AliasVault Web Client versions 0.25.3 and below contain a stored cross-site scripting vulnerability in the email rendering feature, where email HTML is rendered directly via an iframe srcdoc without isolation.
An attacker can send a crafted email containing malicious JavaScript to any AliasVault email alias; when the recipient views it in the web client, the script executes in the application's origin, enabling account takeover and other critical impacts.
Affected context
The vulnerability affects AliasVault Web Client deployments at versions 0.25.3 and below that allow users to view rich HTML emails associated with their aliases.
The issue appears when the client renders received emails using an iframe's srcdoc attribute without applying any HTML/JavaScript sanitization, sandboxing, or origin isolation.
In this context, untrusted email content is treated as trusted application content, causing user-supplied scripts from emails to execute with the same origin as the main application.
Exploit preconditions
- Attack surface: The web-based email viewing interface of the AliasVault Web Client.
- Required access: Ability to send an email to any AliasVault alias (no need for an account on the victim's instance).
- Victim interaction: A logged-in user must open or preview the malicious email in the web client so that the email body is rendered.
- Trigger point: Rendering of the email content into an iframe via
srcdocwithout sanitization or sandbox attributes. - Why exploitation is possible: The email HTML is rendered in the same origin as the application, with no content sanitization or iframe sandboxing, allowing arbitrary JavaScript in the email to run with full access to the application's DOM, cookies (if accessible to JavaScript), local storage, and other web APIs.
Why this happens
The underlying issue is a classic stored cross-site scripting flaw where untrusted content is rendered as active HTML/JavaScript in the browser.
Incoming emails, which are inherently untrusted and attacker-controlled, are inserted into an iframe using the srcdoc attribute without:
- Stripping or neutralizing script elements and dangerous attributes, and
- Enforcing sandbox policies or origin separation that would restrict script execution.
This behavior maps directly to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where user-controlled data is incorporated into a web page without appropriate sanitization or output encoding.
Because srcdoc content inherits the embedding page's origin when not sandboxed, the malicious script runs with the same privileges as the main application.
Potential impact
- Theft of authentication tokens or session information that may allow account takeover.
- Access to and exfiltration of stored passwords, email aliases, and other sensitive vault data available in the web client context.
- Modification of user settings, creation or deletion of aliases, and manipulation of security-related configurations.
- Phishing overlays or deceptive UI elements to trick users into revealing master passwords or MFA tokens.
- Use of the victim's session to perform actions on other linked services (e.g., integrations or synced devices).
- Pivoting to further application vulnerabilities by abusing the authenticated context and APIs.
General mitigation guidance
Mitigation patterns focus on treating all email content as untrusted and limiting its execution capabilities:
- Apply robust HTML sanitization on email bodies before rendering, removing scripts, event handlers,
javascript:URLs, and other active content. - Prefer rendering emails in a sandboxed iframe with restrictive flags (e.g., disallowing scripts and top-level navigation) so that any residual active content cannot affect the application.
- Avoid using
srcdocfor untrusted HTML when it would share origin with the main application; instead, render from a distinct, locked-down origin or use text-only/limited markup rendering. - Enforce a default-deny approach to embedded content: strip or disable forms, iframes, and scriptable components unless explicitly required and safely constrained.
- Follow a least-privilege design in the client: minimize how much sensitive state and capability is exposed to the DOM that renders external content.
How teams detect issues like this
Effective detection often combines code-level review with behavioral testing:
- Static analysis: Scan the codebase for direct insertion of untrusted email content into HTML sinks (
innerHTML, template literals,srcdoc,document.write, or React/Vue raw HTML APIs) without passing through a sanitization function. - Security code review: Examine the email rendering pipeline, confirming that all inbound HTML passes through vetted sanitization libraries and that iframe usages for untrusted content include appropriate sandbox attributes and, where possible, origin separation.
- Automated tests: Add regression tests that attempt to render benign XSS probes in emails and assert that the scripts never execute (e.g., CSP violation logs, test hooks).
- Runtime monitoring: Configure Content Security Policy (CSP) with reporting to flag unexpected inline script execution related to email views, and integrate these reports into security monitoring.
- Policy enforcement: Introduce internal guidelines or pre-commit hooks that flag or block new uses of dynamic HTML rendering APIs for untrusted data.

