Skip to content
XSS Advisory Intermediate CVE-2024-29191CVE-2024-29192CVE-2024-29193

GHSL-2023-205_GHSL-2023-206: Cross-site scripting (XSS) and arbitrary command execution vulnerability in go2rtc - CVE-2024-29191, CVE-2024-29192, CVE-2024-29193

go2rtc had DOM-based XSS in its links and index pages, and a CSRF flaw in its config API that allowed adding a stream which executes arbitrary commands. An attacker could run script in a victim's browser or, via a drive-by page, execute commands on the go2rtc host.

jorgectf Follow

Originally disclosed on GitHub Security Lab

Go2rtc is susceptible to a cross-site scripting (XSS) vulnerability and an arbitrary command execution vulnerability due to the lack of user-input sanitization.

jorgectf, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely missing output encoding and CSRF protection: user-controlled values are inserted with innerHTML, and the config endpoint accepts cross-origin requests without a token.

What the attacker needed

Victim visits a crafted link or page; go2rtc reachable from the victim's browser; config API reachable without auth (localhost)

The fix

The issues were fixed in commits that add sanitisation and CSRF protection.

How it was found

  1. Visit the links page with a crafted src parameter.
  2. Observe the script executing in the browser.
  3. Create a stream with a crafted name via the API.
  4. Load the index page to trigger the stored script.
  5. Patch the configuration to add a stream that runs a command.
  6. Restart go2rtc and request the stream to execute the command.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The web pages of go2rtc put text from the URL or from stream names directly into the page without cleaning it, so a crafted link or stream name can make the browser run attacker-supplied script. Separately, the configuration API accepted changes from any website, and because go2rtc can run commands for streams, an attacker could add a stream that runs a command on the machine.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by jorgectf

View all

34 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.