MEDIUM 5.4

CVE-2026-10585: GitHub Enterprise Server Stored XSS in Q&A Discussions

A vulnerability in GitHub Enterprise Server allows an authenticated user to inject malicious code into discussion titles that executes in other users' browsers. The flaw stems from improper handling of user input in Q&A discussions—specifically, the system failed to sanitize discussion titles before embedding them in structured data markup, creating an opening for attackers to break out of that context and run arbitrary JavaScript. An attacker would need valid credentials and would need to trick another user into viewing the malicious discussion, but the payload could then access that victim's session or sensitive information.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weaknesses (CWE)
CWE-79
Affected products
1 configuration(s)
Published / Modified
2026-06-30 / 2026-07-02

NVD description (verbatim)

A stored cross-site scripting vulnerability was identified in GitHub Enterprise Server that allowed an authenticated attacker to execute arbitrary JavaScript in another user's browser by injecting a crafted payload into the title of a Discussion in the Q&A category. The AnsweredQuestionStructuredDataComponent did not escape user-controlled Discussion titles before embedding them in a <script type="application/ld+json"> block, allowing the title to break out of the script context. The injection was escalated to a full cross-site scripting attack on GitHub Enterprise Server by leveraging JSONP callback support in the REST API to bypass the Content Security Policy. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.21 and was fixed in versions 3.20.4, 3.19.8, 3.18.11, 3.17.17, 3.16.20. This vulnerability was reported via the GitHub Bug Bounty program.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the AnsweredQuestionStructuredDataComponent, which processes Discussion titles for Q&A categories without proper HTML entity encoding before inserting them into JSON-LD script blocks. An authenticated attacker can craft a Discussion title containing a closing script tag followed by arbitrary JavaScript, which breaks the JSON-LD context and executes in the page DOM. The attack surface is further expanded because GitHub Enterprise Server's REST API supports JSONP callbacks, which can be leveraged to circumvent the Content Security Policy restrictions that would normally block such injections. The flaw affects GitHub Enterprise Server versions prior to 3.21, with patches available in 3.20.4, 3.19.8, 3.18.11, 3.17.17, and 3.16.20.

Business impact

Organizations running GitHub Enterprise Server are at risk of session hijacking, credential theft, and unauthorized access to repository data if users are tricked into viewing malicious Q&A discussions created by internal attackers. The attack does not require privilege escalation—any authenticated user can create or modify discussions—making it a concern for insider-threat scenarios or compromised standard user accounts. Data exfiltration and lateral movement within the GitHub environment become possible if an attacker harvests session tokens or personal access tokens from affected users.

Affected systems

All versions of GitHub Enterprise Server prior to version 3.21 are vulnerable. Specifically, patched versions are available in the 3.20.x line (3.20.4 and later), 3.19.x line (3.19.8 and later), 3.18.x line (3.18.11 and later), 3.17.x line (3.17.17 and later), and 3.16.x line (3.16.20 and later). Any instance running versions older than these branch-specific patches remains at risk. Organizations should verify their current version against these thresholds immediately.

Exploitability

Exploitation requires an authenticated account and relies on social engineering to entice victims to view the malicious discussion. The attack is relatively straightforward to execute once a user posts the crafted payload—no additional authentication bypass or privilege escalation is needed. The reliance on user interaction (clicking a link or viewing the discussion) and the requirement for valid credentials keep the CVSS score at Medium (5.4), but the low attack complexity means patching should not be delayed in environments where insider threats or account compromise is a realistic concern.

Remediation

Apply patches immediately for your version branch: 3.20.4+, 3.19.8+, 3.18.11+, 3.17.17+, or 3.16.20+. If you are running version 3.21 or later, you are not affected. Organizations unable to patch immediately should consider disabling or restricting access to Q&A discussions until updates are deployed, and review audit logs for any suspicious Discussion creation or modification activity by authenticated users.

Patch guidance

GitHub has released version-specific patches across multiple release branches. Identify your current GitHub Enterprise Server version (typically available in the web interface under System Settings or via the API), then cross-reference it against the patched versions listed in the vulnerability description. Apply the minimum patch version for your branch—for example, if you run 3.19.x, upgrade to 3.19.8 or later. If you are on an unsupported branch (older than 3.16), contact GitHub support regarding extended support options. Test patches in a staging environment before production deployment to ensure no breakage of existing discussion or API functionality.

Detection guidance

Monitor audit logs for Discussion creation or edits in Q&A categories that contain unusual characters (script tags, angle brackets, JavaScript keywords) in titles. GitHub Enterprise Server audit logs should be reviewed for any authenticated user activity involving AnsweredQuestion or Discussion-related API endpoints. Network-level monitoring for JSONP callback patterns in REST API requests may reveal exploitation attempts. Additionally, scan running instances for HTTP responses containing unescaped user input within <script type="application/ld+json"> blocks, which would indicate the vulnerability is present.

Why prioritize this

Although the CVSS score is Medium, the vulnerability should be prioritized for rapid patching because it affects a centralized platform (source code repository) where unauthorized access can have cascading consequences. The requirement for only basic authentication and the relative ease of exploitation make it attractive to insider threats or account takeover scenarios. Many organizations treat GitHub Enterprise Server as a critical security boundary, making stored XSS in core features a significant risk to patch velocity and incident response planning.

Risk score, explained

The CVSS 3.1 score of 5.4 (Medium) reflects the need for prior authentication and user interaction. The attack vector is Network, Attack Complexity is Low, Privileges Required is Low (any authenticated user), and User Interaction is Required (victim must view the discussion). The impact is limited to Confidentiality and Integrity with no Availability impact. However, the Scope is Changed, meaning the vulnerability can affect resources beyond the vulnerable component—specifically, other users' sessions. This score appropriately captures the threat as non-critical but meaningful; organizations should not deprioritize patching based solely on the Medium rating.

Frequently asked questions

Do we need to patch if all our developers use strong authentication and we monitor login activity?

Yes. The vulnerability requires only basic authentication, which any legitimate user possesses. An attacker with a valid account (compromised or malicious insider) can execute the attack without bypassing authentication. Monitoring login activity alone will not prevent exploitation by existing users. Patch as soon as feasible.

Can we mitigate this without patching by disabling Q&A discussions?

Disabling or restricting Q&A discussions would reduce the attack surface, but it is a workaround, not a fix. The underlying issue—failure to escape user input in JSON-LD blocks—could theoretically surface in other Discussion features. Patching is the proper remediation; temporary access restrictions are acceptable only during a brief transition period.

Will this vulnerability be added to the CISA KEV catalog?

As of the current data, this vulnerability has not been added to CISA's Known Exploited Vulnerabilities catalog. However, the absence of a KEV listing does not mean the vulnerability is low-risk. Patching should not be delayed pending KEV inclusion, especially given the ease of exploitation and the centrality of the affected platform.

How can we detect if this vulnerability was exploited in our instance?

Review audit logs and activity feeds for Q&A Discussion creations or edits by authenticated users, paying particular attention to any titles containing HTML or script-like syntax. Check response headers and page content for unescaped user input in JSON-LD blocks using browser developer tools or automated scanning. If you suspect exploitation, audit the affected user's recent activities and session history for unauthorized repository access or data downloads.

This analysis is based on the vulnerability description and vendor guidance as of the publication date. Organizations should verify patch availability and compatibility with their specific GitHub Enterprise Server deployment before applying updates. Testing in a non-production environment is strongly recommended. SEC.co does not provide legal or compliance advice; security teams should consult internal policies and regulatory requirements when prioritizing patching. No exploit code or weaponized proof-of-concept is provided or endorsed by this analysis. Source: NVD (public-domain), retrieved 2026-08-09. Analysis generated by SEC.co (claude-haiku-4-5).