ezyang / ezyang/htmlpurifier

Missing Whitelist for nofollower, noreferer, noopener

Open
#173 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

I have added a whitelist option to htmlpurifer with and wihout a tld

$config->set('HTML.TargetWhitelist', array('domain1.de','domain2.'));

Reason; you can have multiple domains for a single project or trusted(partner) domains. So here is a option for excluding missing. I have modify multiple files in \library\HTMLPurifier\AttrTransform* and \library\HTMLPurifier\AttrTransform.php itself.

I never make a pull request, but when you have interest in this option, I will try it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing attribute-transform classes under library/HTMLPurifier/AttrTransform/ and library/HTMLPurifier/AttrTransform.php. Trace how nofollower, noreferer, and noopener are handled, then define the whitelist behavior for configured domains such as domain1.de and domain2.; done means the option works consistently across the affected transforms and has coverage for domains with and without a TLD.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.