Skip to content

SimplePie: Disallow javascript: URI protocol#8263

Draft
Inverle wants to merge 2 commits intoFreshRSS:edgefrom
Inverle:frss-sanitize-uri
Draft

SimplePie: Disallow javascript: URI protocol#8263
Inverle wants to merge 2 commits intoFreshRSS:edgefrom
Inverle:frss-sanitize-uri

Conversation

@Inverle
Copy link
Member

@Inverle Inverle commented Nov 29, 2025


if ($this->disallowed_uri_protocols) {
foreach ($this->disallowed_uri_protocols as $protocol) {
$this->strip_uri_protocol($xpath, $protocol);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not looked into it yet, but I hope there is a better place to call this logic from, instead of having to search via XPath again. Probably in the existing URL processing e.g. for relative URLs, sanitising URLs, HTTPS-enforcing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

public function replace_urls(DOMDocument $document, string $tag, $attributes)

@Inverle Inverle marked this pull request as draft December 4, 2025 23:44
@Alkarex Alkarex modified the milestones: 1.28.0, 1.29.0 Dec 20, 2025
Alkarex pushed a commit that referenced this pull request Dec 24, 2025
Some [misconfigured instances](#7835) may be stripping out the CSP header that `f.php` sends, which can be mitigated by forcing the browser to download the image instead of displaying it and executing JS code from unsanitized SVGs for example.

Contributes to #8263 and #7924
(improving security when CSP is not present)
@Inverle Inverle modified the milestones: 1.29.0, 1.28.1 Dec 26, 2025
@Alkarex Alkarex modified the milestones: 1.28.1, 1.29.0 Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants