Emissary has Stored XSS via Navigation Template Link Injection
Published 7 Apr 2026 · Updated 4 Nov 2026
Is your project on an affected gov.nsa.emissary:emissary?
Look after several Java apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <8.39.0
- Fixed in
- 8.39.0
mvn versions:use-dep-version -Dincludes=gov.nsa.emissary:emissary -DdepVersion=8.39.0 -DforceVersion=trueDetails
Summary
Mustache navigation templates interpolated configuration-controlled link values
directly into href attributes without URL scheme validation. An administrator
who could modify the navItems configuration could inject javascript: URIs,
enabling stored cross-site scripting (XSS) against other authenticated users
viewing the Emissary web interface.
Details
Vulnerable code — nav.mustache (line 10)
{{#navItems}}
<li class="nav-item">
<a class="nav-link" href="{{link}}">{{display}}</a>
</li>
{{/navItems}}The {{link}} value was rendered without any scheme validation. Mustache's
default HTML escaping protects against injection of new HTML tags but does
not prevent javascript: URIs in href attributes, since javascript:
contains no characters that HTML-escaping would alter.
Attack vector
An administrator sets a navigation item's link to:
javascript:alert(document.cookie)
Any authenticated user who clicks the navigation link executes the script in their browser context.
Impact
- Session hijacking via cookie theft
- Actions performed on behalf of the victim user
- Requires administrative access to modify navigation configuration
- Requires user interaction (clicking the malicious link)
Mitigating factors
- Exploitation requires administrative access to modify the
navItemsconfiguration - User interaction (clicking the link) is required
- The Emissary web interface is typically accessed only by authenticated operators within a trusted network
Remediation
Fixed in PR #1293, merged into release 8.39.0.
Server-side link validation — NavAction.java
An allowlist regex was added that only permits http://, https://, or
site-relative (/) URLs:
private static final Pattern VALID_LINK = Pattern.compile("^(https?:/)?/.*");
private static boolean isValidLink(String link) {
if (!VALID_LINK.matcher(link).matches()) {
logger.warn("Skipping invalid navigation link '{}'", link);
return false;
}
return true;
}Invalid links are logged and silently dropped from the rendered navigation.
Template hardening — nav.mustache
Added rel="noopener noreferrer" to all navigation link anchor tags as a
defense-in-depth measure:
<a class="nav-link" href="{{link}}" rel="noopener noreferrer">{{display}}</a>Tests were added to verify that javascript: and ftp:// URIs are rejected
while http://, https://, and site-relative (/path) links are accepted.
Workarounds
If upgrading is not immediately possible, audit the navigation configuration
to ensure all navItems link values use only http://, https://, or
relative (/) URL schemes.
References
- PR #1293 — validate nav links
- Original report: GHSA-wjqm-p579-x3ww
Is GHSA-cpm7-cfpx-3hvp in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected gov.nsa.emissary:emissary, and gives you the command that fixes it.
More advisories for gov.nsa.emissary:emissary
- MediumCVE-2026-54442NationalSecurityAgency/emissary has an incomplete fix for CVE-2026-35571 · 30 Oct 2026
- HighCVE-2026-35582Emissary has an OS Command Injection via Unvalidated IN_FILE_ENDING / OUT_FILE_ENDING in Executrix · 13 Apr 2026
- MediumCVE-2026-35583Emissary has a Path Traversal via Blacklist Bypass in Configuration API · 8 Apr 2026
- HighCVE-2026-35581Emissary has a Command Injection via PLACE_NAME Configuration in Executrix · 8 Apr 2026
- CriticalCVE-2026-35580Emissary has GitHub Actions Shell Injection via Workflow Inputs · 8 Apr 2026
- HighCVE-2025-27508Emissary May Use a Broken or Risky Cryptographic Algorithm · 5 Mar 2025
References
- Linkgithub.com/NationalSecurityAgency/emissary/security/advisories/GHSA-cpm7-cfpx-3hvp
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-35571
- Linkgithub.com/NationalSecurityAgency/emissary/pull/1293
- Linkgithub.com/NationalSecurityAgency/emissary/commit/e2078417464b9004620dde28dcbca2f73ea06c13
- Packagegithub.com/NationalSecurityAgency/emissary
- Linkgithub.com/NationalSecurityAgency/emissary/releases/tag/8.39.0
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.