ezyang / ezyang/htmlpurifier

Synk issues for Cross-site Scripting (XSS)-ezyang/htmlpurifier

Open
#450 1 comment 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

Hi Team,
Could you please advise on how to fix the following issues? While running a vulnerability test using Snyk, I found multiple problems in the ezyang/htmlpurifier package. Specifically, unsanitized input from an HTTP header flows into the echo statement in maintenance/flush.php at lines 16, 24, 25, 26, 27, and 28, which may lead to a Cross-Site Scripting (XSS) attack.

Additionally, in maintenance/rename-config.php at line 46, unsanitized input from an HTTP header flow into eval, where it is executed as PHP code, potentially resulting in a Code Injection vulnerability.

A similar XSS issue is present in vendor/ezyang/htmlpurifier/maintenance/rename-config.php at multiple lines, including 19, 29, and 39.

I'm currently using ezyang/htmlpurifier version v4.10.0

Could you please help me resolve this?
https://github.com/ezyang/htmlpurifier/blob/master/maintenance/rename-config.php

Image

Image

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

Review maintenance/flush.php lines 16 and 24-28, maintenance/rename-config.php line 46, and vendor/ezyang/htmlpurifier/maintenance/rename-config.php lines 19, 29, and 39. Trace the reported HTTP-header inputs to the echo and eval statements, then confirm that the XSS and code-injection paths are no longer possible and that the affected maintenance scripts still work as intended.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.