Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(conf): protect hostname resolver from XSS #7043

Merged
merged 3 commits into from
Jan 9, 2019

Conversation

vhr
Copy link
Contributor

@vhr vhr commented Dec 12, 2018

Resolve MON-3228

array('<', '>'),
$_GET['hostName']
);
echo gethostbyname($hostName);
Copy link
Contributor

Choose a reason for hiding this comment

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

should not be better echo htmlentities(gethostbyname($hostName)); ?

Copy link
Contributor Author

@vhr vhr Dec 12, 2018

Choose a reason for hiding this comment

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

If we do that the result will be:
screenshot from 2018-12-12 10-56-55

I propose to strip the tags and remove all chars that are not compatible with the hostname.

@sc979
Copy link
Contributor

sc979 commented Dec 28, 2018

QA validationfailed :'(

@vhr vhr merged commit 05b7590 into 2.8.x Jan 9, 2019
@vhr vhr deleted the MON-3228-xss-hostname-resolver branch January 9, 2019 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants