Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS14Mnh3LWh3OGctNjc3M84AAyrS

govuk_tech_docs vulnerable to unescaped HTML on search results page

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.

Permalink: https://github.com/advisories/GHSA-x2xw-hw8g-6773
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS14Mnh3LWh3OGctNjc3M84AAyrS
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 12 months ago
Updated: 3 months ago


Identifiers: GHSA-x2xw-hw8g-6773, CVE-2024-22048
References: Repository: https://github.com/alphagov/tech-docs-gem

Affected Packages

rubygems:govuk_tech_docs
Dependent packages: 0
Dependent repositories: 123
Downloads: 201,033 total
Affected Version Ranges: >= 2.0.2, < 3.3.1
Fixed in: 3.3.1
All affected versions: 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 3.0.0, 3.0.1, 3.1.0, 3.2.0, 3.2.1, 3.3.0
All unaffected versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 2.0.0, 2.0.1, 3.3.1, 3.4.0, 3.4.5, 3.5.0