CVE-2026-81852: AshAdmin ships a hardcoded CSP nonce, allowing nonce-based CSP bypass
Use of Insufficiently Random Values vulnerability in ash-project ashadmin ships a hardcoded, publicly known CSP nonce, defeating nonce-based Content-Security-Policy protection.
When mounted without :cspnonceassignkey, AshAdmin.Router.ashadmin/2 defaulted the img, style, and script nonces to the literal constant ashadmin-Ed55GFnX, which AshAdmin.Layouts wrote verbatim into the nonce attribute of its inline <style> and <script> tags on every response. The value is a compile-time constant published in the repository and is never rotated per request. If an application's CSP script-src allow-lists that documented default, any HTML-injection sink on an admin page can reuse the known nonce to run inline scripts the policy was meant to block. The fix generates a fresh random nonce per request.
This issue affects ashadmin: from 0.10.8 before 1.3.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ash_adminto a version that resolves this vulnerability.Fixed in 1.3.1 - Configuration
Ensure AshAdmin is mounted with :csp_nonce_assign_key so Router.ash_admin/2 does not default the img, style, and script nonces to the literal constant ash_admin-Ed55GFnX; instead, use the per-request fresh random nonce behavior described in the fix.
AshAdmin.Router.ash_admin/2 csp_nonce_assign_key = set a value so nonces are not defaulted to ash_admin-Ed55GFnX - Operational
After upgrading to ash_admin 1.3.1, verify CSP nonces are generated fresh per request (not the compile-time constant ash_admin-Ed55GFnX) and that existing responses no longer include the hardcoded nonce in inline <style> and <script> tags.
Event History
Frequently Asked Questions
Which deployments are exposed to practical exploitation?
Deployments using ash_admin versions from 0.10.8 before 1.3.1 are affected when AshAdmin is mounted without :csp_nonce_assign_key and the application's script-src CSP allow-lists the documented default nonce. Exploitation also requires an HTML-injection sink on an admin page.
What does an attacker need to bypass the CSP?
An attacker needs a way to inject HTML into an AshAdmin page and can then add an inline script using the publicly known ash_admin-Ed55GFnX nonce. Because the nonce was constant across responses, it could satisfy a CSP that allow-listed that value.
Is the default AshAdmin configuration affected?
Yes. When mounted without :csp_nonce_assign_key, AshAdmin.Router.ash_admin/2 used the fixed nonce for inline image, style, and script elements.
What version resolves the issue?
Version 1.3.1 fixes the issue by generating a fresh random nonce for each request.