The vulnerability in MISP stems from a straightforward context confusion: JsonTool::encode() with JSON_UNESCAPED_SLASHES was used to preserve slash characters in JSON output, and that output was then embedded directly into an HTML script block without additional escaping. The result is a classic XSS—</script> tags embedded in the JSON data break out of the enclosing script tag. The fix is trivial (wrap the value with h()), which is precisely what makes this case instructive: this wasn't a hard vulnerability requiring exotic knowledge, it was a skipped step at the boundary between two output contexts.

The root cause is treating JSON serialization as a security boundary when it's actually just a data-transport decision. JsonTool::encode() is designed to represent data accurately, not to produce HTML-safe output. The JSON_UNESCAPED_SLASHES flag was explicitly chosen to preserve slash characters—likely for URL parameter reconstruction—but the same serialization path was later used for HTML embedding without re-escaping. The developer wasn't incompetent; they were thinking about data fidelity, not output context. The h() function exists elsewhere in the codebase, so the failure wasn't missing knowledge—it was missing context awareness at the point of JSON encoding.

What makes this worth broader attention: MISP is a threat intelligence platform where the data being processed often involves sensitive indicators of compromise, sometimes nation-state infrastructure. The attack surface isn't narrow—analysts in these roles routinely receive crafted URLs as part of their workflow. More importantly, this exact pattern has been documented since at least 2003 across multiple languages and frameworks. The institutional memory exists in CVE databases and secure coding guides, yet the feedback loop between documented vulnerability classes and developer tooling remains broken.

Audit your own codebase: search for JSON encoding with JSON_UNESCAPED_SLASHES or equivalent flags, then trace every insertion point into HTML contexts—particularly script tags, event handlers, or JSONP callbacks. If the JSON layer is treated as a terminal operation that produces "safe" data for downstream rendering, you've built the same false boundary. The fix here was one line, but the architectural question is whether your codebase makes output contexts discoverable at the point where encoding decisions are made—or whether you're relying on individual developers to remember context boundaries that the tooling never makes visible.