Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple issues preventing removal of external references #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aimeos
Copy link

@aimeos aimeos commented Jul 7, 2021

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
Copy link
Author

aimeos commented Jul 14, 2021

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

@ohader
Copy link
Contributor

ohader commented Aug 7, 2021

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
Owner

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

$value = trim($match[1], '\'"');

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

@xerc xerc Feb 14, 2022

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