Skip to content

Tracking: Vendored OpenSSL libraries #570550

Open

Description

@RossSmyth

hx Tracking issue for packages that contain OpenSSL libraries. This is generally not ideal since they are vendored via submodules or something, and will be extremely out of date of security patches. It is generally a good idea to replace these vendored libraries with symlinks to the Nixpkgs built ones so that security patches are propogated to the packages.

Caveats:

This only tracks packages that are built via Hydra, so unfree packages cannot be tracked. There also may be certain sets of packages that are not tracked with nix-index. But the popular package sets are tracked.

Packages

Create with { nix-locate -tr -tx --minimal /openssl.so; nix-locate -tr -tx --minimal /libssl.so; nix-locate -tr -tx --minimal /libcrypto.so; } | sort -u | uniq

  • archipelago.out: 3.0.2
  • aws-lc.out: unknown
  • azure-sdk-for-cpp.openssl.out: 3.5.8
  • boringssl.out: unknown
  • chickenPackages_5.chickenEggs.openssl.out: 3.5.8
  • chickenPackages_6.chickenEggs.openssl.out: 3.5.8
  • glamoroustoolkit.out: unknown
  • graalvmPackages.truffleruby.out: unknown
  • hyperhdr.out: ?
  • julia_112.out: 3.5.6
  • julia-bin.out: 3.5.6
  • julia.out: 3.5.6
  • koreader.out: LibreSSL 4.3.2 vendored
  • libressl_4_2.out: unknown
  • libressl.out: unknown
  • netcat.out: unknown (secretly is libressl)
  • openssl_3_5.out: 3.5.8
  • openssl_3.out
  • openssl_4_0.out: 4.0.3
  • openssl_legacy.out: 3.5.8
  • openssl_oqs.out: 3.5.8
  • pgsql-tools.out: 3.0.2
  • php82Extensions.openssl.out: unknown
  • php83Extensions.openssl.out: unknown
  • php84Extensions.openssl.out: unknown
  • php85Extensions.openssl.out: unknown
  • pyfa.out: 3.5.8
  • robo3t.out: unknown
  • rPackages.openssl.out: 3.5.8
  • ruby_3_3.out: 3.5.8
  • ruby_4_0.out: 3.5.8
  • ruby.out: 3.5.8
  • rubyPackages_3_3.openssl.out: 3.5.8
  • rubyPackages_4_0.openssl.out: 3.5.8
  • rubyPackages.openssl.out: 3.5.8
  • rustls-libssl.out: 3.5.8
  • scilab-bin.out: unknown
  • semgrep-core.out: unknown
  • tor-browser.out: 3.5.9 (interestingly, this is newer than the openssl we have in nixpkgs because tor does not go through staging)
  • wasabibackend.out: 3.0.15: {wasabiwallet,wasabibackend}: drop #574796
  • wasabiwallet.out: 3.0.15: {wasabiwallet,wasabibackend}: drop #574796

TODO:

  • Create tool for extracting the version from the library.

Activity

  1. added
    1.severity: security
    5.scope: tracking
    on Oct 5, 2026
  2. GrimmTheShrimp commented on Oct 5, 2026

    @GrimmTheShrimp
    Contributor

    I know mono also vendors their own fork of boringssl. Which strictly speaking isn't openssl, but similar enough i think it is worth bringing up

  3. vcunat commented on Oct 5, 2026

    @vcunat
    Member

    luaossl clearly seem to be false-positives. There is $out/lib/lua/*/_openssl.so but that's just a binding to Lua which links to the real libssl.so + libcrypto.so (you can check that via ldd $out/lib/lua/*/_openssl.so).

  4. RossSmyth commented on Oct 5, 2026

    @RossSmyth
    ContributorAuthor

    Refined it to only libraries without a prefix

  5. NyCodeGHG commented on Oct 5, 2026

    @NyCodeGHG
    Member

    A lot of rust packages also contain statically linked versions of AWS-LC, we should dynamically link to our copy of it instead.

    I tried scanning for these, but the embedded dependency info from cargo-auditable is not 100% reliable and can contain false positives.

  6. whispersofthedawn commented on Oct 5, 2026

    @whispersofthedawn
    Contributor

    checked off libressl and aws-lc since this is expected, they're both maintained openssl forks

  7. RossSmyth commented on Oct 5, 2026

    @RossSmyth
    ContributorAuthor

    A lot of rust packages also contain statically linked versions of AWS-LC, we should dynamically link to our copy of it instead.

    That is something else I'm working on with #537108

  8. NyCodeGHG commented on Oct 5, 2026

    @NyCodeGHG
    Member

    rustls-libssl also isn't a copy of openssl, it's an openssl shim using rustls

  9. RossSmyth commented on Oct 5, 2026

    @RossSmyth
    ContributorAuthor

    I know mono also vendors their own fork of boringssl. Which strictly speaking isn't openssl, but similar enough i think it is worth bringing up

    Does it have a different file name? I do not see it in the mono output.

  10. samueldr-at-cyberus commented on Oct 5, 2026

    @samueldr-at-cyberus
    Contributor

    FWIW, the ruby library named openssl.so is their bindings for OpenSSL, and not OpenSSL.

  11. samueldr-at-cyberus commented on Oct 5, 2026

    @samueldr-at-cyberus
    Contributor

    From the security room:

    After looking around the strings output of libssl and co. I don't see a great way of finding the version it was built with, so unsure if there's a good automated way of extracting it. Luckily there's not too many so poking around the source repos wouldn't be too bad

    This should do the trick:

    #!/usr/bin/env nix-shell
    #!nix-shell -p 'ruby.withPackages (rp: with rp; [ffi])'
    #!nix-shell -i ruby
    
    require "ffi"
    
    def load_library(lib)
      Module.new do
        extend FFI::Library
        extend self
        ffi_lib lib
    
        # NOTE: This is not built into all OpenSSL builds.
        #attach_function(:version, :'OpenSSL_version', [], :string)
        # So instead we can use these:
        attach_function(:version_major, :'OPENSSL_version_major', [], :int)
        attach_function(:version_minor, :'OPENSSL_version_minor', [], :int)
        attach_function(:version_patch, :'OPENSSL_version_patch', [], :int)
        attach_function(:version_pre_release, :'OPENSSL_version_pre_release', [], :string)
        attach_function(:version_build_metadata, :'OPENSSL_version_build_metadata', [], :string)
    
        def full_version
          [
            version_major,
            version_minor,
            version_patch,
          ].join(".")
        end
      end
    end
    
    ARGV.each do |path|
      lib = load_library(path)
      puts "Path: #{path.inspect()}"
      puts "Version: #{lib.full_version()}"
    end
    .../nixpkgs/nixos-unstable $ ./ssl_version.rb $(readlink -f ./result*/lib/libssl.so)
    Path: "/nix/store/8rfsypg1qj64n6yagj71cbrwxjcig28h-openssl-4.0.3/lib/libssl.so.4"
    Version: 4.0.3
    Path: "/nix/store/k6gk21pqwc61xlraavcjcia70vbjbzii-openssl-3.6.5/lib/libssl.so.3"
    Version: 3.6.5
    
  12. RossSmyth commented on Oct 5, 2026

    @RossSmyth
    ContributorAuthor

    That works. I can probably wire up the equivalent to my Python nix-index tooling I made for Electron/CEF whenever it is merged.

  13. RossSmyth commented on Oct 5, 2026

    @RossSmyth
    ContributorAuthor

    FWIW, the ruby library named openssl.so is their bindings for OpenSSL, and not OpenSSL.

    Is this the same for the top-level ruby packages listed?

  14. samueldr-at-cyberus commented on Oct 5, 2026

    @samueldr-at-cyberus
    Contributor

    FWIW, the ruby library named openssl.so is their bindings for OpenSSL, and not OpenSSL.

    Is this the same for the top-level ruby packages listed?

    Yes, the “OpenSSL” gem is available in rubyPackages as it's one of the gems other gems can depend on, and also as a built-in gem to Ruby. I checked both a ruby package and a rubyPackages.openssl with find [...] -iname '*ssl.so* to double-check there wasn't anything else. Only the openssl.so for the OpenSSL native bindings

  15. 10 remaining items

  16. taranarmo commented on Oct 16, 2026

    @taranarmo
    Contributor

    if you can devendor openssl from Julia package

    Julia's sources are shipped with all deps included, however they try to keep those up to date. I found commits bumping openssl to 3.5.8 in Julia's 1.12 and 1.13 branches, the latter had a release yesterday which includes this patch #574553

  17. RossSmyth commented on Oct 16, 2026

    @RossSmyth
    ContributorAuthor

    The main problem is that it is a game of whack-a-mole since we must rely upon two steps to occur: 1. upstream must bump openssl, then 2. nixpkgs must bump to the new version. It is generally preferred to just symlink our openssl if possible so that it just stays up-to-date. Otherwise I will be pinging you and it will be annoying.

  18. GrimmTheShrimp commented on Oct 17, 2026

    @GrimmTheShrimp
    Contributor

    nix-locate --regex 'libmbed(tls|crypto)\.(so|a)'

    [...]
    julia_111-bin.out                                     0 s /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedcrypto.so
    julia_111-bin.out                               656,900 x /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedcrypto.so.2.28.6
    julia_111-bin.out                                     0 s /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedcrypto.so.7
    julia_111-bin.out                                     0 s /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedtls.so
    julia_111-bin.out                                     0 s /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedtls.so.14
    julia_111-bin.out                               303,400 x /nix/store/wx0qjxdqpnli5zabznxmm19dygr70qkm-julia-bin-1.11.9/lib/julia/libmbedtls.so.2.28.6
    julia_111.out                                         0 s /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedcrypto.so
    julia_111.out                                   569,176 x /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedcrypto.so.2.28.6
    julia_111.out                                         0 s /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedcrypto.so.7
    julia_111.out                                         0 s /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedtls.so
    julia_111.out                                         0 s /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedtls.so.14
    julia_111.out                                   223,432 x /nix/store/gwyjbz1s6p9yl4ilwqk0zp032l9qh9qw-julia-1.11.9/lib/julia/libmbedtls.so.2.28.6
    julia-lts.out                                         0 s /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedcrypto.so
    julia-lts.out                                   553,716 x /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedcrypto.so.2.28.10
    julia-lts.out                                         0 s /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedcrypto.so.7
    julia-lts.out                                         0 s /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedtls.so
    julia-lts.out                                         0 s /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedtls.so.14
    julia-lts.out                                   237,896 x /nix/store/bmhdchd108p57hi2zpyykbivikhylcnz-julia-bin-1.10.12/lib/julia/libmbedtls.so.2.28.10
    

    on the topic of julia, it seems to also vendor mbedtls, and a significantly older version at that.

  19. taranarmo commented on Oct 19, 2026

    @taranarmo
    Contributor

    on the topic of julia, it seems to also vendor mbedtls, and a significantly older version at that

    yeah, 1.10 is LTS (and quite outdated, the next major release should be LTS) and 1.11 is EOL and will be dropped soon

  20. GrimmTheShrimp commented on Oct 19, 2026

    @GrimmTheShrimp
    Contributor

    Then here is a quick reminder that needs to happen before 2026-10-26 according to the Release Schedule for 26.11.

  21. vcunat commented on Oct 19, 2026

    @vcunat
    Member

    or at least marked with .meta.knownVulnerabilities before that date

  22. GrimmTheShrimp commented on Oct 19, 2026

    @GrimmTheShrimp
    Contributor

    netcat = libressl.nc.overrideAttrs (old: {
    meta = old.meta // {
    description = "Utility which reads and writes data across network connections — LibreSSL implementation";
    mainProgram = "nc";
    };
    });

    turns out netcat is secretly libressl

  23. GrimmTheShrimp commented on Oct 19, 2026

    @GrimmTheShrimp
    Contributor

    koreader does some funky stuff.

    ln -sf ${lib.getLib openssl}/lib/libcrypto.so.3 $out/lib/koreader/libs/libcrypto.so.1.1
    ln -sf ${lib.getLib openssl}/lib/libssl.so.3 $out/lib/koreader/libs/libssl.so.1.1

    It has both libcrypto.so.1.1, which is openssl, and libcrypto.so.57 which is libressl, see https://github.com/koreader/koreader-base/tree/master/thirdparty/libressl

    That libressl is vendored: we have a repackaged deb. cc @liberodark @contrun

    Really we should have a full source build instead, with devendored dependencies. Short of that, fix the symlink to replace the shared object with real libressl from nixpkgs now that upstream changed the path under which they expect their libcrypto.so.

  24. IQubic commented on Oct 19, 2026

    @IQubic
    Contributor

    Is there somewhere I can go to review the changes to archipelago?

  25. pyrox0 commented on Oct 20, 2026

    @pyrox0
    Member

    30. Is there somewhere I can go to review the changes to archipelago?

    There haven't been any changes made yet. Since you're a maintainer, if it gets updated, you'll get requested for review.

  26. IQubic commented on Oct 20, 2026

    @IQubic
    Contributor

    30. Is there somewhere I can go to review the changes to archipelago?

    There haven't been any changes made yet. Since you're a maintainer, if it gets updated, you'll get requested for review.

    Thanks. I was noticing that the first post of this thread had a checked box next to archipelag.out so I was confused!

  27. vcunat commented on Oct 21, 2026

    @vcunat
    Member

    I see an unchecked box in there, now at least.

  28. Zaczero commented on Nov 7, 2026

    @Zaczero
    Member

    How is it that NixOS stable ships unsupported OpenSSL by default? No security patches, no updates. How are such decisions even made? Is 3.6.5 but should be 3.5.9 LTS. https://endoflife.date/openssl

  29. whispersofthedawn commented on Nov 7, 2026

    @whispersofthedawn
    Contributor

    that was a mistake. unfortunately, we somehow ended up with our default openssl being a non-lts, and afaik only realized during the 26.05 release cycle. we downgraded unstable to 3.5 once we noticed (#564262), but unfortunately that's too large a change to make on stable. if there are security fixes released, we'll backport them from the appropriate 3.5.x or 4.1.x branch for the next two months, and in the future we'll stick to the lts releases as our defaults.

  30. vcunat commented on Nov 7, 2026

    @vcunat
    Member

    There are only about 7 weeks of support left for 26.05.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.severity: security5.scope: tracking

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions