Vulnerabilities in pkg:gem/govuk_tech_docs

PACKAGE
Advisory Identifier: GHSA-x2xw-hw8g-6773
Advisory Summary

CVE-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.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/govuk_tech_docs

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/govuk_tech_docs. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-x2xw-hw8g-6773 CVE-2024-22048 LOW govuk_tech_docs vulnerable to unescaped HTML on search results page
GHSA-4mvm-xh8j-fv27 - LOW Duplicate Advisory: govuk_tech_docs vulnerable to unescaped HTML on search results page

CVE-2024-22048 at a Glance

CVE Identifier CVE-2024-22048
GHSA Identifier GHSA-x2xw-hw8g-6773
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Govuk tech docs
Package Ecosystem RubyGems
Published Date
Last Updated

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.

govuk_tech_docs fixed: 3.3.1
Upgrade govuk_tech_docs to 3.3.1
Verify Direct and Transitive Dependencies

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

### 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.

CVE-2024-22048 Affected Govuk tech docs Versions

1 component(s)
Fixed Versions:
3.3.1
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?
CVE-2024-22048 is a security vulnerability in Govuk tech docs involving govuk_tech_docs vulnerable to unescaped HTML on search results page under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Govuk tech docs versions are affected?
Affected versions include releases prior to 3.3.1 across affected packages: govuk_tech_docs.
What version fixes CVE-2024-22048?
Upgrading to 3.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is govuk_tech_docs affected?
Yes, govuk_tech_docs is affected in releases prior to 3.3.1. Upgrade your dependency to 3.3.1 or later.
What CWE is associated with CVE-2024-22048?
CVE-2024-22048 is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (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.).
How can I check RubyGems dependencies for CVE-2024-22048?
Run the dependency tree command: 'inspect dependencies for govuk_tech_docs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}