Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. govuk_tech_docs
  4. ›
  5. CVE-2024-22048

CVE-2024-22048: govuk_tech_docs vulnerable to unescaped HTML on search results page

April 11, 2023 (updated November 17, 2025)

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.

References

  • github.com/advisories/GHSA-x2xw-hw8g-6773
  • github.com/alphagov/tech-docs-gem
  • github.com/alphagov/tech-docs-gem/commit/a51c7058cec46bf2a4e25a1da62b14ac3fd46b53
  • github.com/alphagov/tech-docs-gem/pull/323
  • github.com/alphagov/tech-docs-gem/releases/tag/v3.3.1
  • github.com/alphagov/tech-docs-gem/security/advisories/GHSA-x2xw-hw8g-6773
  • github.com/rubysec/ruby-advisory-db/blob/master/gems/govuk_tech_docs/CVE-2024-22048.yml
  • nvd.nist.gov/vuln/detail/CVE-2024-22048

Code Behaviors & Features

Detect and mitigate CVE-2024-22048 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.2 before 3.3.1

Fixed versions

  • 3.3.1

Solution

Upgrade to version 3.3.1 or above.

Impact 6.1 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

Source file

gem/govuk_tech_docs/CVE-2024-22048.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 10 Dec 2025 12:20:39 +0000.