Self XSS in Tag name pattern field /<username>/<reponame>/settings/tag_protection/new
An HTML injection flaw in GitHub Enterprise Server's tag protection settings page allowed a malicious website to make changes to a user account via CSP bypass with created CSRF tokens. Exploitation required user interaction and social engineering, such as dragging and dropping a payload into a textbox.
- Triaged in 7 days
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 5 months
Summary by the program
Cross-site Scripting in the tag name pattern field in the tag protections UI in GitHub Enterprise Server allows a malicious website that requires user interaction and social engineering to make changes to a user account via CSP bypass with created CSRF tokens. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.12 and was fixed in all versions of 3.11.5, 3.10.7, 3.9.10, and 3.8.15. CVE-2024-1084
Summary by the researcher
@ros876 found an HTML injection vulnerability in GitHub's tag protection settings page. The vulnerability occurred when an error response from the check_pattern endpoint got injected directly into the DOM via innerHTML without proper sanitization. Exploitation required the victim to "drag-and-drop" a payload into a textbox, @sudi helped set up the POC for this. The CSP on github.com prevented any script execution from the injected HTML, but @joaxcar proved that an attacker could still perform sensitive actions using a combination of "on-site" script gadgets
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 the error response from the check_pattern endpoint was inserted into the DOM using innerHTML without sanitisation.
Impact
An attacker could make changes to a user account via CSP bypass with created CSRF tokens, but only if the victim interacts and is socially engineered.
What the attacker needed
Victim is logged in; victim drags and drops payload; social engineering required
The fix
The vulnerability was fixed in GitHub Enterprise Server versions 3.11.5, 3.10.7, 3.9.10, and 3.8.15.
How it was found
- Visit the tag protection settings page for a repository.
- Trigger an error response from the check_pattern endpoint.
- Drag and drop a crafted payload into the tag name pattern textbox.
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.
This is a bug where a web page inserted untrusted text into the page without cleaning it first. Normally a security rule called CSP stops injected scripts from running, but the researcher found a way around it using existing scripts on the site. An attacker could then trick a logged-in user into performing actions on their account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.