fix: resolve 12 security findings from audit (SSRF, XSS, CSP, SRI)#53
Merged
Conversation
Client-side SSRF prevention: - IvooxAdapter: validate URL scheme (HTTPS only) and domain (ivoox.com only) before fetching third-party HTML - AzuraCastAdapter: validate API URL scheme (HTTPS only) before fetching - Tighten detectSourceType regexes to match actual domain patterns XSS hardening: - Add URL scheme validation to button, figure, hero, schedule shortcodes (reject javascript:, data:, vbscript: in href attributes) - Add URL scheme validation to podcast-player (audio src) and video shortcodes - Validate program-card icon contains actual SVG markup - Document unsafe=true security implications in exampleSite/hugo.toml Template injection hardening: - Replace endsWith URL matching with proper URL pathname+search comparison (avoids cross-source event handling from coincidental URL suffix matches) - Add sessionStorage state validation (reject non-HTTP schemes on restore) Content Security Policy: - Add CSP meta tag with nonce-based script-src - Apply nonce to all inline scripts (theme toggle, i18n injection, lang redirect, dropdowns) Subresource Integrity: - Add fingerprint + integrity to code-copy.js, podcast-player.js/css RSS/XML injection: - Replace Go-style %q quoting with XMLEscape in atom:link elements - Add XMLEscape to all RSS attribute values (itunes:image, itunes:category, itunes:author, itunes:name, itunes:email, itunes:subtitle, enclosure) Misc: - Use localStorage for language redirect flag (instead of sessionStorage) to prevent repeated redirects in incognito sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive security hardening based on a full codebase audit. Resolves 12 findings across 4 severity levels.
Client-side SSRF prevention (High)
*.ivoox.comonly) before fetching third-party HTMLevil.com/ivoox.com/no longer matches)XSS hardening (High/Medium)
javascript:,data:,vbscript:in href attributesunsafe=truesecurity implications inexampleSite/hugo.tomlTemplate injection hardening (Low)
endsWithURL matching with properurlsMatch()function comparing pathname+search by URL objectContent Security Policy (Medium)
<meta>tag with nonce-basedscript-srcSubresource Integrity (Low)
fingerprint+integritytocode-copy.js,podcast-player.js,podcast-player.cssRSS/XML injection (Medium)
%qquoting withtransform.XMLEscapeinatom:linkelementsXMLEscapeto all RSS attribute values (itunes:image,itunes:category,itunes:author,itunes:name,itunes:email,itunes:subtitle,enclosure)Misc
localStoragefor language redirect flag (instead ofsessionStorage) to prevent repeated redirects in incognito sessionsVerification