CVE-2024-22048
govuk_tech_docs XSS Vulnerability
govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. Malicious JavaScript may be executed in the user's browser if a malicious search result is displayed on the search page.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
6.1
govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. Malicious JavaScript may be executed in the user's browser if a malicious search result is displayed on the search page.
- Record
CVE-2024-22048- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
CVE List
6.1
govuk_tech_docs XSS Vulnerability
govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. Malicious JavaScript may be executed in the user's browser if a malicious search result is displayed on the search page.
- Record
CVE-2024-22048- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79, CWE-79
- Updated
- 2026-11-08
EUVDEUVD-2023-1419
6.1
govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. Malicious JavaScript may be executed in the user's browser if a malicious search result is displayed on the search page.
- Record
EUVD-2023-1419- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-08
GitHub AdvisoriesGHSA-x2xw-hw8g-6773 No score
govuk_tech_docs vulnerable to unescaped HTML on search results page
Impact
Pages that are indexed in search results have their entire contents indexed, including any HTML code snippets. These HTML snippets would appear in the search results unsanitised, so it was possible to render arbitrary HTML or run arbitrary scripts.
This is a low risk security issue; to exploit it, an attacker would need to find a way of committing malicious code to a page indexed by a site that uses tech-docs-gem (which are typically not editable by untrusted users). Their code would also be limited by the relatively short length that's rendered in the corresponding search result. Nevertheless, the XSS would then be triggerable by visiting a pre-constructed URL (/search/index.html?q=some+search+term), which users could be tricked into clicking on through social engineering.
Patches
This has been fixed in v3.3.1. HTML is now sanitised in search results.
- Record
GHSA-x2xw-hw8g-6773- Weakness
- CWE-79, CWE-80
- Updated
- 2026-11-02
OSV
6.1
govuk_tech_docs XSS Vulnerability
govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. Malicious JavaScript may be executed in the user's browser if a malicious search result is displayed on the search page.
- Record
CVE-2024-22048- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-09
OSVGHSA-x2xw-hw8g-6773 No score
govuk_tech_docs vulnerable to unescaped HTML on search results page
Impact
Pages that are indexed in search results have their entire contents indexed, including any HTML code snippets. These HTML snippets would appear in the search results unsanitised, so it was possible to render arbitrary HTML or run arbitrary scripts.
This is a low risk security issue; to exploit it, an attacker would need to find a way of committing malicious code to a page indexed by a site that uses tech-docs-gem (which are typically not editable by untrusted users). Their code would also be limited by the relatively short length that's rendered in the corresponding search result. Nevertheless, the XSS would then be triggerable by visiting a pre-constructed URL (/search/index.html?q=some+search+term), which users could be tricked into clicking on through social engineering.
Patches
This has been fixed in v3.3.1. HTML is now sanitised in search results.
- Record
GHSA-x2xw-hw8g-6773- Weakness
- CWE-79, CWE-80
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
govuk_tech_docsRubyGems |
2.0.2 up to 3.3.1 | 3.3.1 |
govuk_tech_docsRubyGems |
2.0.2 up to 3.3.1, plus listed versions 2.0.102.0.112.0.122.0.132.0.3 Show 22 moreShow less2.0.42.0.52.0.62.0.72.0.82.0.92.1.02.1.12.2.02.2.12.2.22.3.02.4.02.4.12.4.22.4.33.0.03.0.13.1.03.2.03.2.13.3.0 |
3.3.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| references | EUVD, OSV | |
| facts, references | CVE List | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-22048 is a medium vulnerability (CVSS 6.1) in Gov.uk Govuk Tech Docs, published April 11, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.50%, the 43rd percentile. Fixed in govuk_tech_docs 3.3.1.
References
github.com/alphagov/tech-docs-gem/security/advisories/GHSA-x2xw-hw8g-6773
github.com/alphagov/tech-docs-gem/pull/323
github.com/alphagov/tech-docs-gem/releases/tag/v3.3.1
github.com/advisories/GHSA-x2xw-hw8g-6773
vulncheck.com/advisories/vc-advisory-GHSA-x2xw-hw8g-6773
nvd.nist.gov/vuln/detail/CVE-2024-22048