GHSA-x2xw-hw8g-6773

Suggest an improvement
Source
https://github.com/advisories/GHSA-x2xw-hw8g-6773
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/04/GHSA-x2xw-hw8g-6773/GHSA-x2xw-hw8g-6773.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-x2xw-hw8g-6773
Aliases
Published
2023-04-11T15:41:30Z
Modified
2024-11-29T05:41:29.824208Z
Summary
govuk_tech_docs vulnerable to unescaped HTML on search results page
Details

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-79",
        "CWE-80"
    ],
    "severity": "LOW",
    "github_reviewed": true,
    "github_reviewed_at": "2023-04-11T15:41:30Z"
}
References

Affected packages

RubyGems / govuk_tech_docs

Package

Name
govuk_tech_docs
Purl
pkg:gem/govuk_tech_docs

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.0.2
Fixed
3.3.1

Affected versions

2.*

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

3.0.0
3.0.1
3.1.0
3.2.0
3.2.1
3.3.0