GitHub Advisoryadvisory · RubyGems
GHSA-x2xw-hw8g-6773 govuk_tech_docs vulnerable to unescaped HTML on search results page
LOW
Official page ↗
- Aliases
- CVE-2024-22048
- Ecosystem
- RubyGems
- Packages
- govuk_tech_docs
- Severity
- Low
- Weaknesses
- CWE-79, CWE-80
- Reviewed
- 2023-04-11
Affected packages
• RubyGems govuk_tech_docs: >= 2.0.2, < 3.3.1 → fixed in 3.3.1
Description
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.
Related
Alias · CVE (1)
- CVE-2024-22048 govuk_tech_docs versions from 2.0.2 to before 3.3.1 are vulnerable to a cross-site scripting vulnerability. vulnerability
References
- https://github.com/alphagov/tech-docs-gem/security/advisories/GHSA-x2xw-hw8g-6773 web
- https://nvd.nist.gov/vuln/detail/CVE-2024-22048 advisory
- https://github.com/alphagov/tech-docs-gem/pull/323 web
- https://github.com/alphagov/tech-docs-gem/commit/a51c7058cec46bf2a4e25a1da62b14ac3fd46b53 web
- https://github.com/alphagov/tech-docs-gem package
- https://github.com/alphagov/tech-docs-gem/releases/tag/v3.3.1 web
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/govuk_tech_docs/CVE-2024-22048.yml web