Skip to content
DoS Disclosed report Intermediate CVE-2018-10546

DOS in stream filters

A PHP stream filter using iconv with the IGNORE flag can enter an endless loop when reading from a memory stream. An attacker could exhaust CPU or available PHP processes by triggering this filter.

meitis Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Disclosed after 19 months

see bug report https://bugs.php.net/bug.php?id=76249

as simple as

<?php $fh = fopen('php://memory', 'rw'); fwrite($fh, "abc"); rewind($fh); stream_filter_append($fh, 'convert.iconv.iso-10646/utf8//IGNORE', STREAM_FILTER_READ, []); echo stream_get_contents($fh); => one process running in an endless loop ## Impact DOS, process ends up in an endless loop, CPU (or available php processes or both) of affected system get easily exhausted

The original report as published on HackerOne, by meitis. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the iconv stream filter with the IGNORE flag fails to handle certain input correctly, causing an infinite loop.

Impact

The process enters an endless loop, easily exhausting CPU or available PHP processes.

What the attacker needed

Ability to run PHP code with stream filters

How it was found

  1. Open a memory stream for reading and writing.
  2. Write some data to the stream.
  3. Rewind the stream to the beginning.
  4. Append the iconv filter with the IGNORE flag for reading.
  5. Read the stream contents, which causes an endless loop.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A stream filter is a way to transform data as it is read or written in PHP. Here, a specific filter setting causes the program to loop forever instead of finishing, which can tie up the server.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.