CVE-2024-22048: Govuk tech docs Govuk_tech_docs Vulnerable To Unescaped HTML Vulnerability
LOWCVE-2024-22048 is a LOW govuk_tech_docs vulnerable to unescaped html vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Govuk tech docs libraries in the RubyGems ecosystem. The issue involves govuk_tech_docs vulnerable to unescaped html on search results page. Remediation is available by upgrading affected packages to version 3.3.1.
CVE-2024-22048 at a Glance
How to Fix CVE-2024-22048
To remediate this vulnerability, upgrade all affected Govuk tech docs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade govuk_tech_docs to 3.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for govuk_tech_docs
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-22048, inspect your project dependencies for Govuk tech docs:
inspect dependencies for govuk_tech_docs
Analyze the terminal output to locate any version of Govuk tech docs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Govuk tech docs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-22048 Affected Govuk tech docs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
govuk_tech_docs
|
RubyGems |
≥ 2.0.2
< 3.3.1
|
3.3.1
|
References
Frequently Asked Questions
What is CVE-2024-22048?
Which Govuk tech docs versions are affected?
What version fixes CVE-2024-22048?
Is govuk_tech_docs affected?
What CWE is associated with CVE-2024-22048?
How can I check RubyGems dependencies for CVE-2024-22048?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x2xw-hw8g-6773",
"modified" : "2025-11-17T17:32:14Z",
"published" : "2023-04-11T15:41:30Z",
"aliases" : [ "CVE-2024-22048" ],
"summary" : "govuk_tech_docs vulnerable to unescaped HTML on search results page",
"details" : "### Impact\n\nPages 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.\n\nThis 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.\n\n### Patches\n\nThis has been fixed in v3.3.1. HTML is now sanitised in search results.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "govuk_tech_docs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.2"
}, {
"fixed" : "3.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/alphagov/tech-docs-gem/security/advisories/GHSA-x2xw-hw8g-6773"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22048"
}, {
"type" : "WEB",
"url" : "https://github.com/alphagov/tech-docs-gem/pull/323"
}, {
"type" : "WEB",
"url" : "https://github.com/alphagov/tech-docs-gem/commit/a51c7058cec46bf2a4e25a1da62b14ac3fd46b53"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/alphagov/tech-docs-gem"
}, {
"type" : "WEB",
"url" : "https://github.com/alphagov/tech-docs-gem/releases/tag/v3.3.1"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/govuk_tech_docs/CVE-2024-22048.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2023-04-11T15:41:30Z",
"nvd_published_at" : null
}
}