ezyang / ezyang/htmlpurifier

Fortify Scan - XSLT Injection - portal/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php

Open
#220 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

Hi,

We had a fortify scan on our code base to check for possible security vulnerabilities and the following has been reported from this library, request you to look into it.

Issue Description -
Processing an unvalidated XSL stylesheet can allow an attacker to change the structure and contents of the resultant XML, include arbitrary files from the file system, or execute arbitrary PHP code.

Recommendation Offered -
When writing user supplied data to XSL stylesheets some guidelines should be followed: 1. Validate input and whitelist to known good values. 2. XML entity encodes user input before writing to XML.

Occurrences -
1.portal/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php, line 30
2.portal/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php:28

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 inspecting portal/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php at lines 28-30 and identify how the XSL stylesheet is processed. Confirm whether the reported input can be influenced externally and determine a safe, validated handling approach; done means the Fortify finding is addressed without changing intended output or enabling file or PHP inclusion.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.