PT-2023-32944 · Unknown · Govuk Tech Docs
Chrisbashton
·
Published
2023-04-11
·
Updated
2025-11-29
·
CVE-2024-22048
CVSS v3.1
6.1
Medium
| Vector | AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Name of the Vulnerable Software and Affected Versions
govuk tech docs versions from 2.0.2 to before 3.3.1
Description
The issue is 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. 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. 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.
Recommendations
For govuk tech docs versions from 2.0.2 to before 3.3.1, update to version 3.3.1 or later, where HTML is now sanitised in search results. As a temporary workaround, consider restricting access to the search page or sanitising user input to minimize the risk of exploitation.
Exploit
Fix
XSS
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Govuk Tech Docs