LATEST UPDATESEnglish
EENEHI NewsA curated stream of attributed news links
Stay close to the storiesA clear view of source-attributed news headlines.
Technology

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

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

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

devops

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

READ MORE

Visa, Mastercard theft included info useful for phishing, but not draining bank accounts, say researchers 2 days ago

Signal slams door on prying AI agents to protect privacy 2 days ago

China attackers deployed AI agents that autonomously found and exploited a 0-day to take over a university server 2 days ago

Dutch data watchdog highlights safety issues with AI glasses 2 days ago

Spy court blasts UK secrecy, forces government to admit Apple ‘backdoor’ demand 2 days ago

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.

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.

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.

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.

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. ®

As cars go digital, US consumers pay an extra $12 billion a year for repairs

Today's vehicles need software tools to make repairs, and the subscriptions inflate insurance fees

Passive 'ghost' radar can detect airborne threats without revealing its own position

Kit piggybacks off TV and mobile signals and can be neatly stuffed into an SUV

Cyber insurers now want proof you can actually recover

PARTNER CONTENT: As carriers tighten underwriting, a backup job marked green is no longer enough. Here’s the evidence underwriters expect

Come for the science, stay for the big iron: Supercomputer admin on why he loves the job

From the dotcom bubble to 200,00 cores of raw power

A Chinese bottle-cap manufacturer brilliantly deflated AI hype

Pre-digital tech can't be transformed and automated

AWS got hit by an outage too. Here's why you didn't hear about it

If a service falls in the forest and nobody hears it...

TOP STORIES

Microsoft's official Python agent framework hijacked to distribute malware

Microsoft blames monster email outage on software defect introduced in July fix

Optimizely hack turns world's biggest websites into malware dispensers

'Not rocket surgery' claims researcher who found six Danfoss fridge controller zero-days in under an hour

UPDATED Another critical PHP security release has dropped

ON CALL Support tech fixed malware by charging client less for their services

AI

Security shop buys the hand that feeds it

SC26

Selected customers can put Dragonfly AI200 through its paces on Cirrascale's cloud

AI has birthed some truly colossal supers, they just aren't on the Top500

Nvidia unveils an HPC-optimized Rubin GPU to challenge AMD's 288 teraFLOPS MI430X

Ride-hailing biz says stolen credentials allowed crooks to help themselves to driver's license data

Infosec

Security

PLUS: US takes down Iranian propaganda sites; Marketing company asks 'Why Do We Have Your Information?' And more!

Security

PLUS: China upgrades smartphone surveillance tools; Ring eases anti-snooping stance; and more

Black Hat and DEF CON

Voting village reports have been so successful, says Jeff Moss, that the whole of DEF CON will now be included

Security

Went at equivalent of $3.5B+ valuation for entire firm, though portion sold not specified

Malware Month

On the plus side, infosec's a good bet for a long, stable career

FOSS

Canonical's stretch goal is to make the immutable OS standard in 30.04 – without retiring the traditional distro

Cheap tiny e-readers and the perils of LLM-generated drive-by pull requests – plus much more

Devuan-based distro swaps Wayland for XLibre and i3, with Xfce waiting if the tiling gets tiresome

Version 4.0 of Redmond’s cloudy OS is free to use in its cloud. Repeat. Free to use

You can probably guess what he blames for the excessive workload

Only a minority want to ban it. Plus plenty of updates on 16 projects