Commit Graph
9 Commits
Author SHA1 Message Date
dualfroz 018b615a37 Describe this repository 2026-10-22 21:03:40 +02:00
dualfroz 13ce578de8 Stop output buffer cleanup at buffers that cannot be removed
zlib.output_compression makes its buffer non-removable once it has sent
compressed output, so ob_end_clean() raised a notice that replaced the
original exception. Fixes #704.
2026-10-02 16:11:20 +02:00
upstream a5b89f86ae Upstream filp/whoops state of the touched files before 5805bc7620 2026-10-02 16:11:20 +02:00
dualfroz 7f2cd8f154 fix(template-helper): restrict escapeButPreserveUris to http/https schemes
escapeButPreserveUris() matched any scheme via [A-z]+?://, which also
turns javascript://, vbscript:// and data:// URIs into clickable links
on the generated error page, allowing script execution on click (XSS).
The [A-z] class was also invalid, spanning extra ASCII punctuation.

Restrict the scheme to http/https, the only two schemes that make
sense to linkify on an error page, leaving other schemes as plain
escaped text.
2026-09-04 03:00:40 +02:00
upstream 24517bcbde Upstream filp/whoops state of the touched files before 4a1b06f129 2026-09-04 03:00:40 +02:00
dualfroz 1e51c75014 fix(template-helper): restrict escapeButPreserveUris to http/https schemes
escapeButPreserveUris() matched any scheme via [A-z]+?://, which also
turns javascript://, vbscript:// and data:// URIs into clickable links
on the generated error page, allowing script execution on click (XSS).
The [A-z] class was also invalid, spanning extra ASCII punctuation.

Restrict the scheme to http/https, the only two schemes that make
sense to linkify on an error page, leaving other schemes as plain
escaped text.
2026-09-04 22:16:53 +02:00
upstream aed19f01eb Upstream filp/whoops state of the touched files before b6b679db7d 2026-09-04 03:00:40 +02:00
dualfroz 8652196c72 fix: only linkify http and https URIs on the error page
escapeButPreserveUris() matched the scheme with "[A-z]+?://", which accepts
any scheme. A frame comment containing javascript://x.co/?%0Aalert(1) survives
htmlspecialchars() untouched and was then wrapped in an anchor, so clicking it
executed script in the origin of the error page. "[A-z]" is also a code point
range rather than a letter class, so it additionally matched the six characters
between "Z" and "a", making "_://x.co/a" a link too.

Match the scheme with "https?" instead, case-insensitively so uppercase
"HTTP://" keeps working. Other schemes stay as escaped plain text. The editor
integration links are not affected, they are emitted directly by the template
and never pass through this method.

Fixes #791
2026-09-03 14:14:10 +02:00
upstream 238f0d6b9a Upstream filp/whoops state of the touched files before 75ce95dd56 2026-09-03 14:14:10 +02:00