Urgent.News

What's breaking now, across thousands of outlets.

Tech

The Anatomy of CVE-2024-4577: Why You Shouldn’t Abandon PHP Over a CGI Best-Fit Code Page Exploit

When a critical Remote Code Execution (RCE) vulnerability hits a language that powers a large share of the web, the headlines predictably declare the death of the ecosystem. But CVE-2024-4577 is not a flaw in modern PHP itself. It is a subtle interaction between Windows character-encoding mechanics and legacy CGI execution. Here is an architectural teardown of how the best-fit mapping bypass…

A critical Remote Code Execution (RCE) vulnerability was recently discovered in PHP, but it's not a flaw in the modern PHP language itself. Instead, CVE-2024-4577 is a subtle interaction between Windows character-encoding mechanics and legacy CGI execution. Rather than abandoning PHP, here's why you shouldn't panic and what to do instead.

The vulnerability exists due to a best-fit character mapping bypass, where the soft-hyphen character (%AD) is converted to an ASCII hyphen (-) by Windows during the command line parsing process in CGI mode. This allows attackers to inject command-line switches, such as -d (which sets PHP configuration directives), which would otherwise be rejected. The exploit only works on Windows systems using legacy code pages like Traditional Chinese (CP950), Simplified Chinese (CP936), and Japanese (CP932).

Modern PHP architectures, such as PHP-FPM behind Nginx or Apache, and application runtimes like Swoole, are not affected by this vulnerability. PHP 8.0 and earlier have also been patched, so there's no reason to abandon a modern PHP stack. To remediate the issue, upgrade to a patched PHP runtime (8.1.29 or higher for the 8.1 branch, 8.2.20 or higher for the 8.2 branch, and 8.3.8 or higher for the 8.3 branch) and migrate away from legacy CGI execution to PHP-FPM.

For a temporary solution, an Apache rewrite rule can block the specific soft-hyphen sequence used in the CVE-2024-4577 exploit, but this is only a stopgap measure until the runtime is upgraded.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Turning Google Maps results into a CSV for a small outreach project

I recently helped a friend who runs a small web design studio build a list of local businesses to contact. The goal was simple: every bakery and cafe in two neighbourhoods, with phone, website and…

  • A web design studio aimed to compile local businesses for outreach.
  • GMB Scraper extension exported Google Maps data to CSV format.
  • Filtered for businesses without websites to identify potential clients.

How Amazon Handles Millions of Orders on Sale Day - The Engineering Behind It

It's Amazon Great Indian Sale. Midnight strikes. Millions of people hit refresh simultaneously. Your internet slows down. The app feels laggy.

  • Amazon processes 1.4 million items per minute during Prime Day 2024
  • Microservices architecture enables independent scaling of services
  • Eventual consistency allows instant cart additions during sale day

Two vLLM servers on one GPU: the startup check that bites, and the fix

Someone asked on the vLLM tracker how to run a small embedding model next to a chat model on one GPU, so the card isn't half idle.

  • Two vLLM servers run on single RTX 3090 GPU
  • Embedding server set to 10% GPU memory, chat server to 70%
  • Allocated 3% memory utilization for embedding server to succeed

I planted 370 SEO defects in a fake 400-page site to test an auditor

Everything below uses a site I generated. These are test results, not results from anyone's real website. The idea A crawl of your own site already holds most of what an SEO metadata audit needs…

  • Fake 400-page site planted with 370 SEO defects for auditor testing
  • Auditor detected 370 issues across 54 rule codes, including 50 errors
  • Site scored 94 (grade A) with 333 pages graded A and 67 graded B

More from Saturday 24 October →