Skip to content
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

Clarify advisories about crates that read from (not write to) the environment #1190

Closed
briansmith opened this issue Feb 11, 2022 · 3 comments

Comments

@briansmith
Copy link
Contributor

There are some advisories like https://rustsec.org/advisories/RUSTSEC-2020-0159 and https://rustsec.org/advisories/RUSTSEC-2020-0071 that have spawned good discussion and are (probably) leading to good changes to the standard library. However, these advisories also seem to be at odds with the current thinking, which is that it is OK to read from the environment but not write to the environment.

I think these advisories are now distracting from real soundness (memory safety and other race condition) issues like chronotope/chrono#648 that are the result of writing to the environment.

We're in a weird state where we now have issues like #926 that stay open here because we can't agree on whether reading from the environment constitutes a vulnerability. I don't think we can really consider it to be a vulnerability at this point, so I think those advisories should be closed with such an explanation. Are we waiting for the Rust library team to agree and to do the deprecation of env::{set_var,remove_var}?

@briansmith
Copy link
Contributor Author

Oh, sorry, I forgot the main request I had: We should update the text of the RUSTSEC advisories and the related CVE with more explanation of the issue, as the current advisory text, though not totally wrong, not really helpful in helping people understand the issue.

Otherwise, presumably there are many, many RUSTSEC advisories to file against many, many crates, for the same reason.

@tarcieri
Copy link
Member

tarcieri commented Feb 11, 2022

Yeah, this was something we've waffled on a few times as the individual advisories were part of a much bigger systemic issue that goes all the way down to the POSIX API. We had previously rejected some advisories for this and ended up accepting the ones for time and chrono (the latter of which I filed due to the amount of noise people were making), perhaps in haste.

I agree they're not particularly helpful in terms of describing the problem or what action should be taken, even if that's just adding the advisory to audit.toml's ignore list.

In the time since I think there's been a lot of discussion, perhaps in part motivated by the amount of noise this created, and perhaps a clearer path to a solution.

I think at the very least these advisories aren't security critical and can thus be demoted to informational = "unsound" which in turn demotes them to warnings in cargo audit.

We could also consider yanking them, especially if env::set_var is deprecated.

tarcieri added a commit that referenced this issue May 12, 2022
Per #1190, it would be good to move to a policy where
we don't file advisories against crates which perform unsynchronized
reads from the process environment, and instead focus only on crates
which modify the process environment in an unsynchronized manner.
tarcieri added a commit that referenced this issue May 12, 2022
Per #1190, it would be good to move to a policy where
we don't file advisories against crates which perform unsynchronized
reads from the process environment, and instead focus only on crates
which modify the process environment in an unsynchronized manner.
tarcieri added a commit that referenced this issue May 12, 2022
…1241)

Per #1190, it would be good to move to a policy where
we don't file advisories against crates which perform unsynchronized
reads from the process environment, and instead focus only on crates
which modify the process environment in an unsynchronized manner.
rnestler added a commit to rnestler/reboot-arch-btw that referenced this issue May 17, 2022
The advisories have been withdrawn since they don't seem to be security
critical and the problem goes all the way down to the POSIX API.

See rustsec/advisory-db#1190
rnestler added a commit to rnestler/reboot-arch-btw that referenced this issue May 17, 2022
The advisories have been withdrawn since they don't seem to be security
critical and the problem goes all the way down to the POSIX API.

See rustsec/advisory-db#1190
@pinkforest
Copy link
Contributor

Sum summarum:

There are upstream rust-lang/rust issue(s) rust-lang/rust#90308 and libs are well aware of this by now with extensive discussions.

time was only re-filed because the maintainer wanted it back - #1242 (comment)

chrono was only re-filed to advertise fix because there was RiR localtime_r in 0.4.20 - #1310

Filing something against something where the maintainer disagrees that this should be done has made these controversial downstream in addition that there can be no fix in crate itself.

I think our current established policy covers this now - generally if the maintainer agrees we can file and / or there is a fix but there is no straightforward yes / no answer for this as these are controversial - and I believe it would be futile to try to cover this in our docs I think.

Closing as completed since we now have the precedent on this -

Re-open if we need to action any documentation / such fix.

Thanks all 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants