The Jerusalem PostSaudi Arabia says it intercepts three Houthi missiles targeting RiyadhInquirerAnti-narcotics agents nab 2 suspects, seize P4M in meth in Lanao del SurPunchMega churches face succession heat한겨레4년 만의 대중 무역흑자의 역설…반도체 빼면 적자 더 늘어ZDF heuteAktuelle Pressemitteilungen des ZDFCNN Türkİran'dan ABD’ye Irak hatırlatmasıThe Hollywood ReporterUnder Pressure From Struggling Members, SAG-AFTRA Vows to Advocate for Universal Healthcare매일경제170만명 홀린 ‘부캉이’ 이름값이 얼마길래…상표 출원 21건NU.nlVerstappen bijna in bandenstapel na incident met Russell in derde training VegasDeadline‘Yellowjackets’ Stars Melanie Lynskey & Christina Ricci On Misty’s Plot “To Save Themselves” From Shauna: “She’ll Be The Downfall Of Everybody”New Straits Times#SHOWBIZ: Adam Driver, Scarlett Johansson star in New York family crime drama 'Paper Tiger'The Sydney Morning Herald'Unnecessary': F1 rivals tangle in practice
The Daily Newsstand · Free, Always
Saturday, November 21, 2026

PHP 8.6: Things are gonna get a lot more strict around here

Translate

Like a parent disciplining a misbehaving child, PHP’s annual update clamps down on loose default behaviors to curb malicious hacker horseplay.

On Thursday,  PHP version 8.6 was released on its usual yearly schedule, popping up as if the web scripting language hadn’t been under intense scrutiny this past month.

For those who missed it: a swarm of unearthed vulnerabilities has plagued PHP since October, allowing unauthenticated attackers to crash PHP workers or execute arbitrary code on the server. Users of every PHP-based application, including WordPress, Laravel, and Symfony, had to scramble to update their PHP instances. 

The PHP core development community, along with the PHP Foundation, responded with a coordinated release of patched versions of PHP (8.5.13, 8.4.28, 8.3.37, 8.2.36 and the new 8.6) that closed seven critical remote code execution (RCE) flaws in one sweep.

REG AD

In addition to patching specific exploitable holes in the PHP engine, the new version of PHP also tamps down some of PHP’s historically liberal configuration settings.

REG AD

Lucky for PHP, and for the rest of us, core developer Jörg Sowa called out these lax settings in June, when he posted a proposal to set more security-friendly defaults.

Sowa saw that three configuration settings of PHP’s session extension – Strict Mode, HttpOnly, and SameSite – were designed to boost security but shipped “with defaults that leave applications unnecessarily exposed.”

No cookies for impostors

In a retrospective posted last month, the PHP Foundation admitted that consensus-driven gridlock had stalled complex fixes for months and vowed to get patches out the door sooner, should the vulnerabilities leak ahead of the agreed-upon deadline. 

Code-wise, Sowa’s proposal to harden PHP settings was accepted for PHP 8.6. These changes won’t stop the flood of AI-generated CVEs, but at least these holes will be more difficult to exploit.  

For Strict Mode, PHP will no longer accept uninitialized session IDs that it didn’t create itself. Before, an attacker could just plant a made-up session ID on the victim to gain entry. “The built-in files handler checks whether a session file for that ID exists on disk; because an attacker-planted ID has no corresponding file, a fresh random ID is generated instead,” Sowa wrote.

Furthermore, PHP will now, by default, add the HttpOnly flag to its session Set-Cookie header, blocking client-side JavaScript from reading the session ID, which could otherwise be stolen to masquerade as the user. Believe it or not, any script on the page could read it before.

Finally, the server will withhold session cookies on cross-site POST requests, as well as for subrequests and iframes. “Without it, a forged form or link on an attacker-controlled site can trigger authenticated requests using the victim’s session,” Sowa wrote.

REG AD

Going forward, cookies will only be sent on same-site requests and top-level GET navigations, such as clicking a normal link.

Collectively, these changes should thwart session hijacking and cross-site request forgeries. They won’t stop remote code execution hacks, though they will make it a lot more difficult for attackers to gain entry.  

The new release brings some other security-minded changes as well.

The PHP engine will be a lot stricter when it encounters strings with null values (“\0”). In many cases, it will now throw an error rather than silently letting it pass. Null values are a favored trick for triggering RCEs. A C function will treat the null value as the end of the string, processing everything before the null byte and ignoring everything after, much to an attacker’s delight.

Continuing in this spirit of “if you see something, say something,” a number of other PHP functions will also no longer remain silent when things go awry. Operations for closing a file or copying data, for instance, will explicitly return a false value when terminating prematurely or failing, an alert developers could use to minimize data integrity bugs.

Beyond security, PHP 8.6 also comes with a number of new goodies.

PHPers are abuzz over Partial Function Application (PFA), which will let them pre-fill some of a function’s arguments to generate a reusable closure on the fly — leapfrogging JavaScript in this ability. 

The new edition also gets a native polling API, which will be handy for event-driven networking; a stopwatch-like Duration class that can track elapsed time across more than 250 years; and a clamp() function to ensure a given value stays within an acceptable range.

REG AD

Another tricky day for PHP devs

For administrators, this PHP update round may be a bit of a shambles.

As backend software engineer Rajekevin Dourepoulle notes in a blog post, these changes will take effect post-installation only if the configurations aren’t specified elsewhere, such as in an application, framework, or even another php.ini file – all of which can override the PHP settings themselves. 

“In practice: if your deployment reuses the old php.ini (an Ansible template, a COPY php.ini in a Dockerfile, a file copied from server to server), you move to 8.6 and gain nothing, because the explicit session.use_strict_mode = 0 line overrides the new default,” he wrote.

Despite all these heroic efforts, PHP remains the champion of inscrutability. ®

View the original on The Register →

KioskNews shows a cleaned-up reading view extracted from the publisher’s page — the original always lives on their site, not ours.