-
Notifications
You must be signed in to change notification settings - Fork 406
Add advisory for segfault in openssl-probe due to environment setters #2209
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
24d2d14
Create RUSTSEC-0000-0000.md
mmastrac 42844c4
Update RUSTSEC-0000-0000.md
mmastrac 26f7af9
Update RUSTSEC-0000-0000.md
mmastrac 2c95894
Update RUSTSEC-0000-0000.md
mmastrac a285059
Update RUSTSEC-0000-0000.md
mmastrac 7d47527
Update RUSTSEC-0000-0000.md
mmastrac 83e4283
Update RUSTSEC-0000-0000.md
mmastrac baa0e08
Update RUSTSEC-0000-0000.md
mmastrac ece1d78
Update RUSTSEC-0000-0000.md
mmastrac 09303e9
Update RUSTSEC-0000-0000.md
mmastrac 88789ba
Update crates/openssl-probe/RUSTSEC-0000-0000.md
mmastrac 874bdda
Update RUSTSEC-0000-0000.md
mmastrac f079478
Update RUSTSEC-0000-0000.md
mmastrac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
```toml | ||
[advisory] | ||
id = "RUSTSEC-0000-0000" | ||
package = "openssl-probe" | ||
date = "2025-01-10" | ||
url = "https://github.com/alexcrichton/openssl-probe/issues/30" | ||
references = ["https://www.edgedb.com/blog/c-stdlib-isn-t-threadsafe-and-even-safe-rust-didn-t-save-us"] | ||
informational = "unsound" | ||
categories = ["memory-corruption"] | ||
cvss = "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H" | ||
keywords = ["ssl", "openssl", "environment"] | ||
|
||
[affected.functions] | ||
"openssl_probe::try_init_ssl_cert_env_vars" = ["< 0.1.6"] | ||
|
||
[affected] | ||
os = ["linux"] | ||
|
||
[versions] | ||
patched = [">= 0.1.6"] | ||
``` | ||
|
||
# `openssl-probe` may cause memory corruption in multi-threaded processes | ||
|
||
`openssl-probe` offers non-`unsafe` methods that call environment setters, which may be called | ||
in a multithreaded environment, and potentially clash with environment access on other threads. | ||
mmastrac marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
When these methods are called while other threads are active and accessing the environment, it | ||
may cause the other threads to access dangling pointer values in the cases where the underlying | ||
environment data is moved or resized in response to an additional environment variable being | ||
added, or a variable's contents being enlarged. | ||
|
||
This is shown to occur on Linux, but it will also likely occur on any other platform where `getenv` | ||
and `setenv` are not thread-safe, though trigger conditions may vary widely. | ||
|
||
The affected function is `try_init_ssl_cert_env_vars` in | ||
<https://github.com/alexcrichton/openssl-probe/blob/db67c9e5b333b1b4164467b17f5d99207fad004c/src/lib.rs#L65>. | ||
|
||
The crate's author released a fix in versions `>=0.1.6` which marks these functions as `unsafe` and `#[deprecated]`. | ||
mmastrac marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.