mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
fix: address code scanning alerts — URL sanitization, workflow harden… (#298)
* fix: address code scanning alerts — URL sanitization, workflow hardening, XSS - CI workflow: add top-level permissions (contents: read) - Docker publish: gate on head_repository == self to block fork-based pwn - URL checks: replace substring matching with proper hostname parsing (eval.py, model_registry.py, console/server.py) - renderer.js: allowlist URL schemes (http/https) for images and links - app.js: escape backslashes before quotes in CSS selector construction * fix: break CodeQL taint chain — normalize image URL via URL constructor * fix: address review — scheme-less URL handling, protocol-relative rejection, data:image allowlist - Normalize scheme-less base URLs before hostname parsing (eval, model_registry, console/server) so api.openai.com without https:// still matches - Reject protocol-relative URLs (//host) in image and link allowlists - Allow data:image/ URIs for inline MCP resource images - Tighten image source to https:// only (no relative paths) * fix: route data: URIs through URL constructor to break CodeQL taint chain
This commit is contained in:
@@ -7,6 +7,9 @@ on:
|
||||
pull_request:
|
||||
branches: [main, "stable/*"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -19,7 +19,9 @@ env:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
if: github.event.workflow_run.conclusion == 'success'
|
||||
if: >-
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.head_repository.full_name == github.repository
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
Reference in New Issue
Block a user