hn.today

Sourcehut account takeover via build logs (XSS in ansi2html)

blog.arusekk.pl61 points10 comments
Screenshot of Sourcehut account takeover via build logs (XSS in ansi2html)

A researcher found a wormable cross-site scripting flaw in the ANSI-to-HTML conversion used by builds.sr.ht: ansi2html improperly handled OSC 8 hyperlink escape sequences so an attacker who can make arbitrary text appear in a build log (for example by sending a patch to a public mailing list or printing a remote resource during a build) can inject HTML attributes or javascript: URLs into anchors. When an authenticated user views the malicious log, the injected script can read the page’s CSRF token or use the existing resubmit-build form to submit jobs as that user, including jobs that use deploy keys. The practical impact includes full account takeover of viewers, access to deploy keys (including some for sr.ht itself on builds.sr.ht), and automated worm propagation across viewers.

The issue was reported and fixed: builds.sr.ht added automatic sanitization of ansi2html output and ansi2html upstream was updated with patched releases. The vulnerability was assigned CVE-2026-92973; affected ansi2html versions include >=1.7.0, =0.40.0, and <0.105.1. Recommended defenses are enforcing a stricter Content-Security-Policy, additional output sanitization, and refactoring the ansi2html parser. Indicators of compromise include raw log occurrences of OSC 8 escapes with embedded quotes or javascript: URLs (grepable by an ESC/7 pattern), and the researcher provides a full disclosure timeline and suggested CVSS vectors arguing for high/critical severity.

Read on blog.arusekk.pl10 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.

Sourcehut account takeover via build logs (XSS in ansi2html) · hn.today