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

example: HTML escape WHOIS registrant data #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jpnock
Copy link

@Jpnock Jpnock commented Mar 14, 2023

Issue

It is possible for WHOIS registrant data to include HTML tags. Many domain registrars will sanitise this input, however it is relatively simple to add HTML to the remarks section of WHOIS data if you control an Autonomous System or IP block.

The example script in this repo does not escape the $result['rawdata'] and thus if HTML is included within the WHOIS response, it is directly rendered on the page if the script is invoked as follows example.php?query=AS_NUMBER.

I have reproduced this behaviour locally.

What does this PR do?

  • Escapes the $result['rawdata'] to make sure that a WHOIS response does not cause HTML from that response to be rendered
  • Additionally, escapes the Whois error results as a good precaution

Example

For example, without the fix, this query can change the stying of the page to blue rather than white.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant