Skip to content

Multiple issues preventing removal of external references - #50

Open
aimeos wants to merge 2 commits into
darylldoyle:masterfrom
aimeos:master
Open

Multiple issues preventing removal of external references#50
aimeos wants to merge 2 commits into
darylldoyle:masterfrom
aimeos:master

Conversation

@aimeos

@aimeos aimeos commented Jul 7, 2021

Copy link
Copy Markdown

If removeRemoteReferences(true) is used, the current code fails to remove attributes with namespaces (e.g. "xlink:href"), "http" and "ftps" URLs and all URLs not wrapped in url('...').

@aimeos

aimeos commented Jul 14, 2021

Copy link
Copy Markdown
Author

@darylldoyle Can you have a look at the PR because without, Server-Side Request Forgery is possible

@ohader

ohader commented Aug 7, 2021

Copy link
Copy Markdown
Collaborator

Seems to be reasonable. I'll add some more test-cases covering the new behavior during the next few day - in case somebody else is faster, please don't hesitate... 😉

@darylldoyle

Copy link
Copy Markdown
Owner

Is it possible to get some test cases added for this please?

Comment thread src/Sanitizer.php
$value = trim($match[1], '\'"');

return preg_match('~^((https?|ftp|file):)?//~xi', $value);
return preg_match('~^((http|https|ftp|ftps|file):)?//~xi', $value);

@xerc xerc Feb 14, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return preg_match('~^((https?|s?ftps?|file):)?//~xi', $value);

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.

4 participants