Skip to content

treewide: add knownVulnerabilities to old libxml2#421204

Merged
alyssais merged 1 commit intoNixOS:masterfrom
alyssais:libxml2-knownVulnerabilities
Jul 1, 2025
Merged

treewide: add knownVulnerabilities to old libxml2#421204
alyssais merged 1 commit intoNixOS:masterfrom
alyssais:libxml2-knownVulnerabilities

Conversation

@alyssais
Copy link
Member

Users should be informed if they're using packages that are deliberately opting in to using old versions of dependencies with vulnerabilities that have otherwise been fixed in Nixpkgs.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@alyssais alyssais requested review from a team, gepbird, khaneliman and ryand56 June 30, 2025 10:22
@alyssais alyssais added the 1.severity: security Issues which raise a security issue, or PRs that fix one label Jun 30, 2025
Users should be informed if they're using packages that are
deliberately opting in to using old versions of dependencies with
vulnerabilities that have otherwise been fixed in Nixpkgs.
@alyssais alyssais force-pushed the libxml2-knownVulnerabilities branch from 656abf4 to ce31d25 Compare June 30, 2025 10:26
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 30, 2025
Comment on lines +93 to 96
libxml2' = libxml2.overrideAttrs (oldAttrs: rec {
version = "2.13.8";
src = fetchurl {
url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also do this

Suggested change
libxml2' = libxml2.overrideAttrs (oldAttrs: rec {
version = "2.13.8";
src = fetchurl {
url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz";
libxml2' = libxml2.overrideAttrs (finalAttrs: oldAttrs: {
version = "2.13.8";
src = fetchurl {
url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${finalAttrs.version}.tar.xz";

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's orthogonal to this change, as it could have been done originally as well.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jun 30, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of replicating this in various places, it'd be easier to maintain with a conditional on the version in the libxml2 package's meta section itself.

It also makes it harder to opt out of it (accidentally or intentionally).

@ryand56 ryand56 added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jun 30, 2025
@gepbird
Copy link
Contributor

gepbird commented Jun 30, 2025

What about vendored libxml2.so.2 like this?

cp usr/lib/x86_64-linux-gnu/libxml2.so.2 $out/lib/libxml2.so.2

@alyssais
Copy link
Member Author

alyssais commented Jul 1, 2025

What about vendored libxml2.so.2 like this?

cp usr/lib/x86_64-linux-gnu/libxml2.so.2 $out/lib/libxml2.so.2

Should be investigated but not in scope for this PR.

@alyssais
Copy link
Member Author

alyssais commented Jul 1, 2025

Instead of replicating this in various places, it'd be easier to maintain with a conditional on the version in the libxml2 package's meta section itself.

It also makes it harder to opt out of it (accidentally or intentionally).

There are various ways we could unify this, and I don't want to delay telling users about the deliberate vulnerabilities on painting the rest of the bikeshed.

Copy link
Contributor

@gepbird gepbird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@alyssais
Copy link
Member Author

alyssais commented Jul 1, 2025

@wolfgangwalther what do you want to happen here? I'm spending my time and energy cleaning up after a mistake here, I only have so much of that I can dedicate, and it's running pretty thin. Would you like to open a PR after this is merged to unify them? Why is it on me to do additional package cleanup work just because I volunteered to sort the unmarked vulnerabilities?

@wolfgangwalther
Copy link
Contributor

wolfgangwalther commented Jul 1, 2025

I'm confused ( 😕 ), because "delaying" seems like a pretty weak argument. If quickness to deliver is the most important metric here, this could have been merged yesterday after the first two approvals already.

I gave 👎 because it feels unfair to brush my comment off as bikeshedding. It's clearly not out of scope, because it's about the change you made. And it's also not some minor bikeshedding, because you're fixing something that is already more hacky than we'd like (all the libxml2 overrides) with even more duct tape.

Note, that I did not "request changes", so I am not blocking anything. I'd be perfectly happy with a comment along the lines of "yeah, you're right, but I'm not up for it, so I'll proceed as-is". It's just the reasoning and the way your comment came across that I am unhappy with.

Why is it on me to do additional package cleanup work

I'd like to strongly oppose this. At no time, I asked for neither additional work, nor package cleanup. I only talked about the change you made. You repeated the same knownVulnerabilities in multiple places, where I said: This can be done better. Better as in "more maintainable". Which is key here, because that's how we got here.

@alyssais
Copy link
Member Author

alyssais commented Jul 1, 2025

I gave 👎 because it feels unfair to brush my comment off as bikeshedding.

Ah, that's my fault then. I think your comment was completely reasonable, I just don't think this should need to be blocked on it. I don't think it was bikeshedding to suggest unifying them, but I expected that any attempt to unify them would invite bikeshedding, because there were multiple ways for that to be done, and I don't think security markings should be help up for refactors.

Note, that I did not "request changes", so I am not blocking anything. I'd be perfectly happy with a comment along the lines of "yeah, you're right, but I'm not up for it, so I'll proceed as-is". It's just the reasoning and the way your comment came across that I am unhappy with.

None of this was clear, because all the only communication I had to work with was "👎". In the absence of more information, all I can get from that is that there's some sort of problem with the PR, and I don't understand what it is, which makes me nervous about merging. I'd urge strong caution about using the 👎 reaction for that reason — since it communicates so little except for a negative attitude, it's a recipe for conflict and misunderstanding. (IMO it was a mistake for GitHub to ever add it. It's a rare exception where 👎 can have a positive impact on a conversation.)

I'd like to strongly oppose this. At no time, I asked for neither additional work, nor package cleanup. I only talked about the change you made. You repeated the same knownVulnerabilities in multiple places, where I said: This can be done better. Better as in "more maintainable". Which is key here, because that's how we got here.

To me it wasn't about the change I made — two mistakes had been made here: one was adding the same package override three times, and the other was not listing the vulnerabilities, and I was fixing one of them. We had three instances of the same package before, and three after. Nothing about listing the vulnerabilities makes any future change any harder. But I would very much like to solve this problem, I'd just like to use my energy on a more systemic fix. That's what I'm trying to do in #421201.

@alyssais alyssais merged commit 5bd32a7 into NixOS:master Jul 1, 2025
31 of 32 checks passed
@alyssais alyssais deleted the libxml2-knownVulnerabilities branch July 1, 2025 19:08
@wolfgangwalther
Copy link
Contributor

None of this was clear, because all the only communication I had to work with was "👎".

Yes, this was not intended, sorry about that. I got distracted immediately after reacting, before writing up an explanatory comment. When I came back - you had already seen and responded to it.

@alyssais
Copy link
Member Author

alyssais commented Jul 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: security Issues which raise a security issue, or PRs that fix one 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants