CVE-2024-22048
JSON

6.1medium

govuk_tech_docs XSS Vulnerability

Severity
6.1medium CVSS:3.1 by CISA-ADP
Exploit likelihood
0.50% (higher than 44% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-x2xw-hw8g-6773

Description

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.

Affected

Product or packageVersionsReported by
govuk_tech_docsfrom 2.0.2 before 3.3.1CVE List
govuk_tech_docs (RubyGems)from 2.0.2 before 3.3.1GitHub Advisory Database
gov.uk govuk_tech_docsfrom 2.0.2 before 3.3.1NVD

All scores

CISA-ADP6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHublow rating
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79CWE-80

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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.

NVD (es)

Las versiones de govuk_tech_docs desde la 2.0.2 hasta la 3.3.1 anteriores son afectados por una vulnerabilidad de cross site scripting. Se puede ejecutar JavaScript malicioso en el navegador del usuario si se muestra un resultado de búsqueda malicioso en la página de búsqueda.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-22048 changed 2026-11-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-x2xw-hw8g-6773 changed 2026-07-08CC-BY-4.0
NVDCVE-2024-22048 changed 2026-07-14Public domain