Skip to content
Info disclosure Disclosed report Advanced

get_icu_value_internal out-of-bounds read

Several PHP intl functions that accept user input could read past the end of a string because the underlying ICU function did not ensure null termination, leading to an out-of-bounds read and heap memory disclosure. An attacker could potentially leak sensitive heap data through these functions.

fms Follow

Originally disclosed on HackerOne

Bounty$500 View original
  • Fixed in 5 days
  • Paid in 5 days
  • Disclosed after 3.4 years

https://bugs.php.net/bug.php?id=72241

Absence of null character terminator causes unexpected zend_string length and leaks heap memory when using several intl functions that commonly receive user input:

  • locale_canonicalize
  • locale_filter_matches
  • locale_lookup
  • locale_parse
  • locale_get_primary_language

This affected PHP version 5.5, 5.6 and 7.0, patch released today:

http://php.net/ChangeLog-5.php#5.5.36

The original report as published on HackerOne, by fms. 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 ICU function get_icu_value_internal did not ensure the input string was null-terminated, causing PHP to use an incorrect length and read beyond the buffer.

Impact

An attacker could potentially leak heap memory contents through the affected intl functions, though the report does not specify the extent of the leak or whether it is reliably exploitable.

What the attacker needed

PHP 5.5, 5.6, or 7.0 with intl extension; ability to pass input to affected intl functions

The fix

A patch was released for PHP 5.5.36; the text does not say whether other branches were fixed.

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.

Some PHP functions that handle language and locale settings (like locale_get_primary_language) take text from users. If that text is not properly ended with a special 'stop' character, the function can accidentally read beyond the intended text and expose bits of memory that should be private. This is called an out-of-bounds read and can leak information.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by fms

View all

33 more disclosed reports, best first.

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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.