Skip to content

pkgs/README: Document security expectations for new packages#405187

Merged
LeSuisse merged 1 commit intoNixOS:masterfrom
LordGrimmauld:pkg-readme-security
May 19, 2025
Merged

pkgs/README: Document security expectations for new packages#405187
LeSuisse merged 1 commit intoNixOS:masterfrom
LordGrimmauld:pkg-readme-security

Conversation

@LordGrimmauld
Copy link
Contributor

@LordGrimmauld LordGrimmauld commented May 8, 2025

Motivation: Many package additions add unmaintained or otherwise problematic packages. Many additions for browser forks, questionable encryption libraries or 10+ years unmaintained software exist. These are frequently closed, but the expectations are not actually visibly documented.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: policy discussion Discuss policies to work in and around Nixpkgs label May 8, 2025
@LordGrimmauld LordGrimmauld added the 1.severity: security Issues which raise a security issue, or PRs that fix one label May 8, 2025
@nix-owners nix-owners bot requested a review from infinisil May 8, 2025 10:18
@github-actions github-actions bot added 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 May 8, 2025
pkgs/README.md Outdated
Comment on lines 43 to 44
Copy link
Member

@7c6f434c 7c6f434c May 8, 2025

Choose a reason for hiding this comment

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

Suggested change
* Web engines like chromium and gecko receive frequent updates. Any package which does not keep up-to-date web engines should be considered vulnerable.
* (Web-)Services working on untrusted input should have a maintained and responsible upstream.
* Packages typically used with untrusted data (e.g. received over the network) should have a maintained upstream responsive to issue. For example:
* Web engines like chromium and gecko receive frequent updates. Any package which does not keep up-to-date web engines should be considered vulnerable.
* (Web-)Services working on untrusted input should have a maintained and responsible upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do "untrusted data received over the network should", i see little reason to restrict this to network things. Though in practice most untrusted data is network stuff, not everything is.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I switched to «e.g.» myself a minute later. I do think that any network data needs a justification of trustworthiness, so an «e.g.» is a good thing unless we have a wide-ish category which is just as bad. I mean, rich enough implementations PDF & DOC(X) & XLS(X) & video containers probably are as bad, but there are few examples who even try.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have For example: at the end of the line. Imo it makes more sense to just add a bullet point for archive unpackers (a common source of untrusted input) to have a non-network example and call it a day

Copy link
Member

Choose a reason for hiding this comment

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

I just think that non-browser network clients are sometimes horrible in their own way.

pkgs/README.md Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Any ideas how to word that most of the time we want some kind of known-competent upstream for such things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"known-competent" is a difficult consideration. I wrote "responsible" and considered "reasonable due diligence", but getting this concise yet precise is hard. My intention is not to outright ban niche upstream devs. I'd already be happy if upstream has available communication channels to disclose (security) issues and then acts on them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pushed an attempt to specify this a bit more, hope this helps

@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from 651f365 to e67a670 Compare May 8, 2025 10:58
@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from e67a670 to f936135 Compare May 8, 2025 11:23
@LordGrimmauld LordGrimmauld requested a review from 7c6f434c May 8, 2025 11:25
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 8, 2025
@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from f936135 to d587e26 Compare May 8, 2025 14:48
@patka-123
Copy link
Contributor

patka-123 commented May 8, 2025

Looks like a worthwile addition, kuddo's! It's not overly prescriptive and trying to be "exact", yet worded usefully as a guiding list to help with due dilegence.

(normally I wouldn't comment because it's too nitpicky and rude for marginal benefit, but this is a docs PR, sooo... don't forget to be consistent with punctuation at the end of list items)

@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from d587e26 to 9ac177c Compare May 8, 2025 15:29
@patka-123
Copy link
Contributor

patka-123 commented May 8, 2025

What I've noticed recently while doing the package drop work is that (non forge hosted) upstreams regularly have a questionable/flaky history if you browse through the web archive. Maybe that's a useful metric that can be used to decide whether to decide on the "trustworthiness"?

Or perhaps this will make the list too long and a reason for people to not read it, for marginal benefit. Just a thought, ignore as desired :)

@LordGrimmauld
Copy link
Contributor Author

My intention was very much to define the lowest imaginable level of expectations. Restricting years-old unmaintained browser forks and such, something to point to when closing pull requests. I'd be inclined to agree there is more metrics and considerations for a package to be considered "good". But those considerations are likely too complex/controversial and probably should go through RFC. You also have to remember any hard metric we add needs enforcing.

@patka-123 patka-123 added the 8.has: documentation This PR adds or changes documentation label May 8, 2025
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label May 8, 2025
@LordGrimmauld
Copy link
Contributor Author

Huh, ofborg exploded... But i didn't actually write any nix code, i believe i didn't break it.

@7c6f434c
Copy link
Member

7c6f434c commented May 9, 2025

@ofborg eval

@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch 2 times, most recently from 8b8cb3d to 1bc8273 Compare May 13, 2025 13:00
@LordGrimmauld
Copy link
Contributor Author

Alright, i changed some of the things @Pandapip1 pointed out. I didn't agree with all the suggested wording, though most of the concerns brought forward were actually valid. Here is hoping this is starting to shape into something usable.

@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from 1bc8273 to 53dcd98 Compare May 14, 2025 13:31
@Eveeifyeve
Copy link
Member

There could also be documentation for firefox forks expectation since there is not much documentation on it and the only signs is in the matrix and github as the recent comment: #363992 (review)

@mweinelt do you agree?

@LordGrimmauld
Copy link
Contributor Author

There could also be documentation for firefox forks

There already is, Gecko is explicitly mentioned.

@Eveeifyeve
Copy link
Member

There could also be documentation for firefox forks

There already is, Gecko is explicitly mentioned.

A documented link would be great if there is a security policy

@LordGrimmauld
Copy link
Contributor Author

If you think there is something actually missing from this, then make a proper review. As it stands, i wouldn't even know what you mean by a "documented link ".

Gecko is listed explicitly (see https://github.com/NixOS/nixpkgs/blob/53dcd98bdd148780f5c3be1265af071e4996457d/pkgs/README.md?plain=1#L45). If your "documented link" is supposed to point to Gecko upstream guidelines: No. Putting external links that point out of the readme is a bad idea, something i will NOT do. It should be possible to understand all expectations without visiting different websites.

Doing the research about upstream (and for forks, upstream of upstream) is the job of a packager. Putting something about Zen in here feels oddly specific, and was your job when you opened that Zen PR. Yes this readme update was opened to specifically shut down questionable browser forks from actively endangering users - that does not mean we should start bloating our docs.

There might not even be an upstream document, Gecko upstream is free software - they won't stop forks from being created. It is on the package repositories to enforce standards for whatever is being packaged, not the original project. This is that documentation.

Other maintainers might even apply hard time limits, like the 48-72h mentioned in emilys comment. While i would agree those limits would be helpful to judge, this readme update is the first step to improving the (currently messy) situation. I won't put explicit limits in here (yet), as those would likely need even more consideration better suited for an RFC.

@mweinelt
Copy link
Member

mweinelt commented May 16, 2025

How about one more rule?

Packages with large attack surfaces (e.g. browsers) require an active committer as a maintainer, so that security updates can be delivered swiftly (usually within 48 hours, but at most 7 days).

This is so there is no reliance on review resources we don't have, which would hinder shipping security updates and also to prevent that the package will effectively be maintained through @r-ryantm, that bumps the package in uncertain intervals that cannot be controlled or relied upon.

@LordGrimmauld
Copy link
Contributor Author

Packages with large attack surfaces (e.g. browsers) require an active committer as a maintainer

I see your point, but not sure i fully agree currently.
I'd immediately agree that yes, a committer stepping up and maintaining a fast-moving target (as you do with Firefox) is good and helps keep users safe. However: Your wording prohibits someone from picking up maintainer status if there is a document basically saying they need commit bit first, and committer requires taking responsibility. This is a chicken-and-egg problem.

If i were to add a point like that, I'd be very verbose that is specifically about new packages, as some (non-committer) maintainer stepping up is still preferable to having no listed active maintainer. As such, adoptions should explicitly be fine, even by non-committers.

@7c6f434c
Copy link
Member

Strictly speaking, a requirement for having an active committer as a maintainer does not restrict additional non-committer maintainers, and nor even the non-committer maintainers doing most of the work most of the time with the committer maintainer making sure their work gets reviewed and merged quickly. There are some precedents of such for non-velocity-critical packages at least.

@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from 53dcd98 to 9bc53d5 Compare May 17, 2025 10:17
@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from 9bc53d5 to baee6c2 Compare May 17, 2025 10:30
pkgs/README.md Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Any security-critical fast-moving package such as Chrome or Firefox (or their forks) should have at least one active committer among the maintainers. This ensures no critical fixes are delayed unnecessarily, endangering unsuspecting users.
* Any security-critical fast-moving package such as Chrome or Firefox (or their forks) must have at least one active committer among the maintainers. This ensures no critical fixes are delayed unnecessarily, endangering unsuspecting users.

"should" does not "ensure" anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright alright fine, you win. Hard gatekeep criteria don't quite sit right with me, but if we can shut down all the questionable browsers then by all means... Done.

Motivation: Many package additions add unmaintained or otherwise problematic packages.
Many additions for browser forks, questionable encryption libraries or 10+ years unmaintained software exist.
These are frequently closed, but the expectations are not actually visibly documented.
@LordGrimmauld LordGrimmauld force-pushed the pkg-readme-security branch from baee6c2 to 6cd1df5 Compare May 17, 2025 11:49
@LordGrimmauld LordGrimmauld mentioned this pull request May 17, 2025
13 tasks
@leona-ya leona-ya mentioned this pull request May 18, 2025
13 tasks
@LeSuisse LeSuisse requested a review from a team May 19, 2025 08:10
Copy link
Member

@LeSuisse LeSuisse left a comment

Choose a reason for hiding this comment

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

The pull request has been open for 10 days, has received multiple approvals, and the described set of expectations has not been significantly challenged in the last few days.

I think we can merge at this point. We can still readjust later if needed and/or go the RFC route if a more authoritative document becomes necessary.

@LeSuisse LeSuisse merged commit fbb150f into NixOS:master May 19, 2025
20 of 21 checks passed
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/can-i-add-libraries-with-no-dependents-inside-nixpkgs/66396/1

LordGrimmauld added a commit to LordGrimmauld/nixpkgs that referenced this pull request Dec 31, 2025
Librewolf is in a bad shape. Not just in nixpkgs, but upstream as well.

In nixpkgs, browsers have been a constant painful argument.
I have written up NixOS#405187 to clarify some security requirements for packages.
While Librewolf doesn't immediately violate the requirements outlined there,
we should strive for better than just the absolute minimum.
Personally, I no longer feel confident in my ability to adequately contribute,
test, and backport Librewolf updates. The past few months have been stressful IRL,
and maintaining a browser in nixpkgs is no longer sustainable for me.
In the time I intended to take a break, NixOS#471511 was opened to update to 146.0.1.
This was not merged in a timely manner, despite me not being the only committer among LW maintainers.

librewolf-bin isn't looking much better. NixOS#464467 is open since Nov 24th,
entirely unacceptable for a browser. The single remaining maintainer, @DominicWrege,
already proposed dropping the package entirely, LeSuisse marked it vulnerable in the meantime.

The situation upstream does not look much better. Checking the [commit history](https://codeberg.org/librewolf/source/commits/branch/main),
they are barely keeping up with upstream firefox. The maintainers have
repeatedly communicated (on matrix) they were close to burning out.
The code changes being done are mostly bumps with patch rebases,
removals of patches which no longer apply, and a lot of somewhat trivial changes.
Very few substantial changes to librewolf itself are made.

I originally switched to Librewolf when firefox expanded their enshitification efforts,
at a time where search engine policies were not possible to define with mainline firefox.
Mainline started supporting search engine policies since. While enshitification
did not slow down, librewolf does not keep up sufficiently to combat that effectively.
I appreciate the project for what it does and tries to do.
But i no longer believe the project is sustainable.
Not in nixpkgs, and probably not upstream either.

Well, what now? I am not the last maintainer of librewolf source package.
I am hoping someone else will step up, and maybe start actually committing open PRs too.
Personally, i will be moving back to mainline firefox, and apply [Phoenix](https://github.com/celenityy/Phoenix).
Phoenix has a nice flake, and does not require a browser recompile for the changes it does.
Phoenix does many of the things librewolf does, while imposing less of a maintainance burden.

I wish the best of luck to all remaining librewolf maintainers.
Hythera pushed a commit to Hythera/nixpkgs that referenced this pull request Feb 26, 2026
Librewolf is in a bad shape. Not just in nixpkgs, but upstream as well.

In nixpkgs, browsers have been a constant painful argument.
I have written up NixOS#405187 to clarify some security requirements for packages.
While Librewolf doesn't immediately violate the requirements outlined there,
we should strive for better than just the absolute minimum.
Personally, I no longer feel confident in my ability to adequately contribute,
test, and backport Librewolf updates. The past few months have been stressful IRL,
and maintaining a browser in nixpkgs is no longer sustainable for me.
In the time I intended to take a break, NixOS#471511 was opened to update to 146.0.1.
This was not merged in a timely manner, despite me not being the only committer among LW maintainers.

librewolf-bin isn't looking much better. NixOS#464467 is open since Nov 24th,
entirely unacceptable for a browser. The single remaining maintainer, @DominicWrege,
already proposed dropping the package entirely, LeSuisse marked it vulnerable in the meantime.

The situation upstream does not look much better. Checking the [commit history](https://codeberg.org/librewolf/source/commits/branch/main),
they are barely keeping up with upstream firefox. The maintainers have
repeatedly communicated (on matrix) they were close to burning out.
The code changes being done are mostly bumps with patch rebases,
removals of patches which no longer apply, and a lot of somewhat trivial changes.
Very few substantial changes to librewolf itself are made.

I originally switched to Librewolf when firefox expanded their enshitification efforts,
at a time where search engine policies were not possible to define with mainline firefox.
Mainline started supporting search engine policies since. While enshitification
did not slow down, librewolf does not keep up sufficiently to combat that effectively.
I appreciate the project for what it does and tries to do.
But i no longer believe the project is sustainable.
Not in nixpkgs, and probably not upstream either.

Well, what now? I am not the last maintainer of librewolf source package.
I am hoping someone else will step up, and maybe start actually committing open PRs too.
Personally, i will be moving back to mainline firefox, and apply [Phoenix](https://github.com/celenityy/Phoenix).
Phoenix has a nice flake, and does not require a browser recompile for the changes it does.
Phoenix does many of the things librewolf does, while imposing less of a maintainance burden.

I wish the best of luck to all remaining librewolf maintainers.

(cherry picked from commit 4525c1a)
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 6.topic: policy discussion Discuss policies to work in and around Nixpkgs 8.has: documentation This PR adds or changes documentation 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.