[audit] Security, AX compliance, missing tests, error handling #4

Open
opened 2026-03-22 16:41:00 +00:00 by Virgil · 2 comments
Member

Full audit:

  1. Security: path traversal, injection, panics on untrusted input, race conditions
  2. AX compliance: os.Getenv → core.Env, filepath.* → core.Path*, fmt.Sprintf → core.Sprintf, strings.* → core.*, errors.New/fmt.Errorf → core.E
  3. Missing tests: exported functions without test coverage
  4. Error handling: silently dropped errors, bare panics, missing nil checks
  5. UK English: American spellings in comments/docs
  6. Missing usage-example comments on exported identifiers
  7. Missing SPDX licence headers

Report all findings with severity and file:line. Do NOT fix.

Full audit: 1. Security: path traversal, injection, panics on untrusted input, race conditions 2. AX compliance: os.Getenv → core.Env, filepath.* → core.Path*, fmt.Sprintf → core.Sprintf, strings.* → core.*, errors.New/fmt.Errorf → core.E 3. Missing tests: exported functions without test coverage 4. Error handling: silently dropped errors, bare panics, missing nil checks 5. UK English: American spellings in comments/docs 6. Missing usage-example comments on exported identifiers 7. Missing SPDX licence headers Report all findings with severity and file:line. Do NOT fix.
Author
Member

Codex Audit Findings

HIGH (2)

  1. WASM entrypoint passes caller strings into html.Raw — XSS via untrusted JS input (cmd/wasm/main.go:29-44)
  2. El/Attr escape names but don't validate — whitespace/= can inject extra attributes (node.go:76-111)
## Codex Audit Findings ### HIGH (2) 1. WASM entrypoint passes caller strings into html.Raw — XSS via untrusted JS input (cmd/wasm/main.go:29-44) 2. El/Attr escape names but don't validate — whitespace/= can inject extra attributes (node.go:76-111)
Author
Member

Fix Applied

Commit 0db16a9: fix: harden wasm slot rendering and html names

  • WASM entrypoint sanitised — extracted render_layout.go with safe rendering
  • El/Attr now validate tag/attribute names — reject invalid chars
  • Added render_layout_test.go (45 lines) + node_test.go (39 lines)
## Fix Applied Commit 0db16a9: fix: harden wasm slot rendering and html names - WASM entrypoint sanitised — extracted render_layout.go with safe rendering - El/Attr now validate tag/attribute names — reject invalid chars - Added render_layout_test.go (45 lines) + node_test.go (39 lines)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

-

Dependencies

No dependencies set.

Reference: core/go-html#4
No description provided.