registry/internal/api
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Radoslav Dimitrov fbfd63ced8
fix(ui): encode publisher-controlled URLs for href attribute context (#1248)
The catalogue page interpolates publisher-supplied URL fields
(`server.repository.url`, `server.websiteUrl`) inside `href="..."`
attributes via `innerHTML`, escaping them with a
`textContent`→`innerHTML`
helper. Per the HTML5 fragment-serialisation algorithm, that round-trip
encodes only `&`, `<`, `>`, and U+00A0 inside text nodes — it does not
encode `"` or `'`. The helper is therefore safe in element-text
contexts (where it is used for `name`, `version`, `description`, etc.)
but unsafe inside an attribute value.

Add an attribute-safe `escapeAttr` helper that follows the OWASP
attribute-encoding rule (also encodes `"` and `'`) and use it for the
two `href` interpolations. Element-text usages keep the existing
`escapeHtml` and remain unchanged. A short comment on each helper
documents the contexts they cover so future fields are wired up
correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 09:25:41 -04:00
..
handlers/v0 fix(ui): encode publisher-controlled URLs for href attribute context (#1248) 2026-05-04 09:25:41 -04:00
router security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
cors_test.go feat: add CORS support to registry API (#711) 2025-10-27 18:07:13 +00:00
openapi_compliance_test.go Ensure tests are failing CI (#840) 2025-12-11 09:56:57 +02:00
server.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00
server_test.go security: fix open redirect and add small hardening (#1227) 2026-04-29 19:14:00 -04:00