-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
elmPackages.elm: Fix runtime TLS connection to package.elm-lang.org #414495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Resolves NixOS#414208 by downgrading version of TLS library used to compile executables. See upstream issue for more context elm/compiler#2325
Hello, I still have the issue:
|
@YievCkim what commit of nixpkgs are you on? Make sure you are using one which includes this PR |
Hello @miniBill How can I check that ? I have upgraded my packages just after seen this PR five minutes ago. I follow the channels of last release (2025-05) :
I usually upgrade my packages with:
Is there something to do ? |
I found it:
But I have no idea if this one is before or after. Maybe I have to wait... |
Ok I think the PR was merged in master but not in release-25.05 |
@NixOS/security This change downgrades the version of the Haskell I think downgrading the An alternative solution would be to patch the Elm compiler to disable EMS when it uses the Finally, it seems abundantly clear that Elm is no longer properly maintained upstream. The compiler repo itself was last committed to almost two years ago. It does not seem appropriate for nixpkgs to include packages like this that are not maintained and require security downgrades to package. I understand there is still an active elm community, but until that community revives maintenance on its core tools and infrastructure, I think removal from nixpkgs could very well be the right decision. |
Thanks for the ping and the summary @ElvishJerricco ! Downgrading the TLS library does not seem like an appropriate solution (there are pretty good reasons why TLS 1.0 and 1.1 and some setups are disabled). That does not seem like a nixpkgs specific issue. Given it seems there is little chance for short term progress upstream, is there any reason left for us at nixpkgs to tag the whole thing with |
There are Elm users (myself included) who would like to be able to continue using Elm via nixpkgs. I've also tagged Elm's author on Slack to make him aware. That said – there's definitely something more to this as that original issue referenced is not consistently reproducible (we run Lamdera, a full-stack Elm PaaS with thousands of Elm apps that continues to install packages from packages.elm-lang.org just fine) so I'm skeptical the current assessment of the failure mode has the full picture. We're actively looking into this. |
Elm compiler is using TLS in client code connecting to server running on https://package.elm-lang.org/ The main point of downgrade is to make it compatible with the server. For hardcode nix users this might not be a big problem. If you're using nix to build your elm you're probably using elm2nix and don't need to use elm binary to fetch dependecies. Long term elm users might not run into issues either. Elm has a local cache located in Downgrade of this library as you can see is local specifically to the elm package. It doesn't leak anywhere. It's not specific to nixpkgs version. Official binaries, homebrew etc all have the tls 1.* code. Regarding maintenance - It's fair to say that elm is some 6 years old at this point. But it's still used heavily - including by http://search.nixos.org |
If the issue is that the Elm package server doesn’t support Extended Main Secret and it’s agreed that this is not a meaningful security issue (it seems like lack of EMS breaks the security of session resumption, which the package server advertises support for, but it may be that Elm does not use it on the client end, or it can be disabled), then it seems like using the latest version of Of course ideally the server would be fixed instead. |
@emilazy 100% agree. I think this merge (downgrade) is not as big of a problem as it might seem. the TLS client really is used only for contacting packages.elm-lang.org. That's said definitely preferrable option to me would be:
But I don't think removing elm or marking it as vunerable in meantime is necessary. Of course I'm open to arguments. |
Could you please tell me when this fix will be available in unstable channel ? I try to find the information but excepted checkout the repo I don't see a way to do that from github directly. |
@YievCkim This doesn't really belong here and is in general hard to tell because we know nothing about your setup. But in general: let nipkgsElmFix = fetchFromGithub { ....this is the revision };
in (import nixpkgsElmFix {}).elmPackages.elm See https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs here is one example from my old repo (pre flakes) https://github.com/turboMaCk/planning-game/blob/e505701295ffb9e2fcd6b417d17f31db83d15c97/default.nix#L2-L7 If you're using flake use flake way to do this. There is no black magic. Just get the version of nixpkgs you want to get in a way that makes sense to get in your setup. |
thank you @turboMaCk for the way to fetch directly from GH. I would like to know when the PR was merged in official channels. Because I follow channels for update. I didn't even know that some people directly follow the master in their setup until today. |
This question is impossible to answer since you did not even mention which channel you are actually using. But I would suggest to continue this discussion on https://discourse.nixos.org/ where we can be more specific and it would also be more visible to people more people. I would normally not mind discussing this under PR but there is still some ongoing discussion with security team which needs resolving and dragging all these people through an off topic is not very respectful. Please open a thread there - I'll be checking it. |
unstable:
But we can continue on discourse with pleasure: Or slack: |
Fix purely in elm-compiler: bmillwood/elm-compiler@c8ca5e1 I tested that a previously-failing |
oh yes a 0.19.2 🤩 |
I now have this in
I do not know how to turn this into a nixpkgs PR. I'm hoping someone else more familiar with the elm packaging will be able to pick that up. |
@bmillwood thanks for stepping up. I think I can open PR for nixpkgs side of things. |
Haskell TLS library is no longer pinned to 1.9.0 in master. I believe this resolves all current security concerns. That being said I do aknowledge that
is and will keep being problematic. The best we can do is try to resolve all problems as they arise until we will no longer be able to. Unconfortable as this might be for people who are, like me, invested in keeping elm around I appriciate the honesty @ElvishJerricco |
417682 resolved |
@turboMaCk This should now be fixed on the server side, so we can probably revert it? |
Yes we no longer need patch for this. |
PR #442132 |
Resolves #414208 by downgrading version of TLS library used to compile executables.
See upstream issue for more context elm/compiler#2325
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.