PHP2Shell 9.2 CVE published today

Today, the patches for two 9.2 CVEs in PHP 5-8 called https://en.wikipedia.org/wiki/PHP2Shell were published. Is there any progress of getting them into Nixpkgs?

Relevant PR is merged

https://github.com/NixOS/nixpkgs/pull/576853

1 Like

Somehow didnā€˜t find that, thanks :slight_smile:

so I see that the PR is in master. cool.

I’m on 26.05. I’ve shut down my nextcloud for now. How should I go about getting this on my system?

Could just wait until those commits appear in 26.05. I assume that means that updating my system then will pull in the new stuff. When should we expect that to happen? A few hours, or a few days maybe?

There’s also this pkgs.applyPatches. Not quite sure where its supposed to go (wiki is down!), but here it is with the three php commits I found in master. Better just to wait on 26.05 to update?

              applyPatches {
                src = pkgs.path;
                patches = [
                  (pkgs.fetchpatch {
                    url = "https://github.com/NixOS/nixpkgs/commit/81513f364091c759812f716cef3c175109d07342.patch";
                    sha256 = "81513f364091c759812f716cef3c175109d07342";
                  })
                  (pkgs.fetchpatch {
                    url = "https://github.com/NixOS/nixpkgs/commit/ee62357e90778a37aa7aa4a646e7ccd4fdb643b3.patch";
                    sha256 = "ee62357e90778a37aa7aa4a646e7ccd4fdb643b3";
                  })
                  (pkgs.fetchpatch {
                    url = "https://github.com/NixOS/nixpkgs/commit/81513f364091c759812f716cef3c175109d07342.patch";
                    sha256 = "8122eb15f960d1e04ab982e4ee971c374133a1e8";
                  })
                ];
              };
2 Likes

Currently using this:

The update broke the fileinfo extension. This overlay fixes it:

            (final: prev: {
              php84Extensions.fileinfo = prev.php84Extensions.fileinfo.overrideAttrs {
                postConfigure = ''substituteInPlace tests/bug68996.phpt --replace-fail "No such file or directory in" "Invalid or incomplete multibyte or wide character in"'';
              };
            })

nixos-26.05 has this update now (among others).

4 Likes

NixOS Search still shows unpatched version (for example 8.3.35 not 8.3.36). Does it get reflected there later?

that information can be slightly stale sometimes (hours, rarely days)

You can see which commit the data from `nixos search` comes from

That’s surprisingly fast, has something changed about the build process or is php simply leafy enough as an interpreted language that the mass rebuilds go quick? Normally this takes days or weeks, not a few hours.

For others in the thread, the nixos-small channels are also a nice escape hatch (in fact, the intended one) for when you need to apply a patch fast, they’re usually updated very quickly because only a small scope of packages are built. That way you don’t have to faff with semi-manual patches.

Wait, does it ?

That link says no

That’s the PR for master/unstable. For 26.05 you need to use Nixpkgs Tracker

4 Likes

Few packages in nixpkgs depend on PHP. But that’s nothing to do with being interpreted. Python is a huge rebuild, for example.

Hi,

I hope this is the right thread.

Disclaimer: I did not contribute to nixpkgs (yet) and do not have experience about the packaging process.

I somehow do feel let down by how this situation was handled.
(nixos-26.05 taking 1d, nixos-unstable still vulnerable)

Is there any reason not to just merge this through to all branches / channels and accept hydra build failures + empty caches / mass rebuilds ā€œon the edgeā€ + failing / broken packages?
I was quite pissed seeing other infra on Debian and even Docker containers being patched while I still had to wait for the mitigation be merged into nixpkgs.

Is there any progress / working group / person investigating how to change the process in such a way that its fast enough to handle current threat scenarios.

TLDR: Imho just merge security fixes fast and accept breaking (even critical) software by doing so.

PS: My english my sound harsh / weird as its not my native language

best borbitter :slight_smile:

1 Like

FWIW, nixos-26.05-small and nixos-unstable-small were significantly faster, and perhaps we could’ve done a better job making this more widely known

Security Team | Nix & NixOS (though of course that team juggles many more issues, potential improvements, etc)

3 Likes

In general, it feels like we should be recommending the -small channels in documentation more prominently to people running internet-facing headless servers, or at least recommend them more prominently to server operators when there are security issues in the non--small channels.

3 Likes