wezterm: unbundle vendored libraries - #370353
Conversation
Wezterm ships with an outdated version of zlib (1.2.11) that has some known security issues: - CVE-2018-25032 - CVE-2022-37434 - CVE-2023-45853 In general we should avoid shipping bundled libraries, so this also unbundles the other libraries since upstream basically uses upstream libraries without patches. See: wezterm/wezterm#6540.
|
CC @SuperSandro2000 for review. |
|
|
|
| prePatch = '' | ||
| tar -xf ${freetype.src} --strip-components=1 -C deps/freetype/freetype2 | ||
| tar -xf ${libpng.src} --strip-components=1 -C deps/freetype/libpng | ||
| tar -xf ${zlib.src} --strip-components=1 -C deps/freetype/zlib | ||
| tar -xf ${harfbuzz.src} --strip-components=1 -C deps/harfbuzz/harfbuzz | ||
| ''; |
There was a problem hiding this comment.
We should really make it link against our built packages normally rather than just extracting their source code if at all possible.
There was a problem hiding this comment.
I have zero experience in Rust to do so, but yes this would be the correct approach.
| tar -xf ${freetype.src} --strip-components=1 -C deps/freetype/freetype2 | ||
| tar -xf ${libpng.src} --strip-components=1 -C deps/freetype/libpng | ||
| tar -xf ${zlib.src} --strip-components=1 -C deps/freetype/zlib | ||
| tar -xf ${harfbuzz.src} --strip-components=1 -C deps/harfbuzz/harfbuzz |
There was a problem hiding this comment.
Not sure if we should do that when there are files that are generated against the source code https://github.com/wez/wezterm/blob/main/deps/harfbuzz/src/lib.rs
There was a problem hiding this comment.
Upstream just updated all libraries to their last version when I asked them, so it seems fine.
| tar -xf ${freetype.src} --strip-components=1 -C deps/freetype/freetype2 | ||
| tar -xf ${libpng.src} --strip-components=1 -C deps/freetype/libpng | ||
| tar -xf ${zlib.src} --strip-components=1 -C deps/freetype/zlib |
There was a problem hiding this comment.
https://github.com/wez/wezterm/tree/main/deps/freetype seems to be not updated that often
There was a problem hiding this comment.
Looks like 2.13 is just new enough to dodge a bunch of really nasty vulnerabilities.
|
I think we kind of just have to set |
I don't think setting |
|
We are not going to set knownVulnerabilities as long as hydra is not building the package! Wezterm takes ages to compile (30+ minutes on my laptop) and that will make the experience miserable for everyone! If we would just build vulnerable packages I would not care that much but that idea was heavily desputes for reasons I totally do not agree with. IMO I have my doubts that those CVEs are actually exploitable in wezterm. I need to double check for what zlib is used but the font rendering libraries are only parsing fonts set by the user and not untrusted user input, so the risk is acceptable IMO. |
The problem here is that rust bindings are generated against them. They might be compatible with the next 4 updates and with the 5th we get incomprehensible linking and compiler errors I have zero capacity to work on or fix within a reasonable timeframe. Crates ending with -sys have the same problem but usually seem to work good enough across updates. I mean sure, we can go that route and pray for the best but as soon as there is any issue with compiling against a newer library, I can only offer to remove the code again as I am missing time and skills to adequately fix those issues. |
This is not how it works. I understand your strong feelings on the matter but the consensus was pretty clearly against Hydra building insecure packages in #351429 and If we can demonstrate that the vulnerabilities are not exploitable then that’s another thing, but that is a high bar to clear and many vulnerabilities have been incorrectly claimed to have no practical impact in the past. I agree that source‐based unbundling is not a good solution when there is checked‐in pregenerated binding code that may not be compatible with newer versions. Using
|
|
I talked with Wez in Matrix and he said he will update the embedded There is no plan to support system libraries though, so I think the best thing for now will be to switch to unstable branch for Wezterm. Once this happens I can open a PR switching to unstable, does this looks like a good solution @SuperSandro2000 @emilazy ? |
|
I think it's reasonable to expect that fonts can be trusted. We also trust PATH and LD_LIBRARY_PATH to not contain malicious code. |
Remember that I am not necessary talking about This is why my suggestion to switch to unstable builds for wezterm, now that upstream upgraded all bundled libraries (it is still using harfbuzz 9.0.0, but AFAIK no known issues here). |
|
|
Yes. Upstream seems to have bumped their bundling: wezterm/wezterm@0eaf755 we should just switch to unstable in this case. They even switched away from the fork. |
|
Replacement PR: #370838. |
Wezterm ships with an outdated version of zlib (1.2.11) that has some known security issues:
In general we should avoid shipping bundled libraries, so this also unbundles the other libraries since upstream basically uses upstream libraries without patches.
See: wezterm/wezterm#6540.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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.