orca
orca copied to clipboard
fix: pr-bug-scan validated finding from #2715
Automated fix-PR from pr-bug-scan for parent #2715.
Fixer status: FIXED_WITH_CODE_PROOF
Summary: Restored source-aware validation in sanitizeRepoIcon so 'github' and 'favicon' image sources cannot point at arbitrary HTTPS hosts.
Blocked proof link: ``
Typecheck: skipped — no local tsc binary in worktree (npx tsc rejected by repo guard, node_modules/.bin/tsc absent)
Proof (from validator)
- C1 — proof_type:
code_analysis- trigger: A repoIcon entry with type='image', source='github' (or 'favicon'), src='https://attacker.example/track.png' reaches sanitizeRepoIcon (e.g., persisted in orca-data.json or via repos.update IPC).
- observable: Renderer renders
for a repo whose icon source is 'github', issuing a network request to an attacker-controlled host (tracking pixel / SSRF surface in renderer). - path:
- src/shared/repo-icon.ts:34 isSupportedImageSrc now matches /^https://[^\s]+$/i for any non-upload source
- src/shared/repo-icon.ts:55 sanitizeRepoIcon returns the icon unchanged because IMAGE_SOURCE_IDS.has('github') and the permissive regex passes
- src/shared/repo-icon.test.ts removed assertion that {source:'github', src:'https://example.com/icon.png'} returns undefined — proves the constraint was load-bearing pre-diff
Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.