-
Notifications
You must be signed in to change notification settings - Fork 91
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
Pre-releases are not distinguished from releases #455
Comments
I'd accept a patch for this because I know the handling is incorrect for pre-releases, but they are also annoying and relatively rare so it's IMO low priority. |
Yeah cool just figuring what our canonical is and happy to send a patch after, I've asked others around preferences but I think: rustsec/rustsec#690 (comment) may end up as our intended canonical. e.g. in axum-core we would end up with 0.3.0 being patched with simply this:
As our canonical would be lexicographic and pre-releases would be "lesser than" release:
Problem would be in any tooling where SemVer 0.3.0 is seen as "before" or "lesser than" pre-releases e.g. in a case where 0.3.0 would still end up as vulnerable if patched is marked as >= 0.3.0-rc.2 so I'm just going around to inquire some preferences / expectations. |
Describe the bug
axum-core here: rustsec/advisory-db#1417 (comment) has the below pattern:
It's a problematic pattern as we cannot currently say for various reasons including resulting implicit arithmetric:
Mostly above fails due to overlapping versions and we went through several iterations -
Until we came up with something like this:
Tested with cargo audit: rustsec/advisory-db#1417 (comment) - works as expected
And tested with cargo deny: rustsec/advisory-db#1417 (comment) - doesn't recognise
0.3.0-rc.1
as affectedSome pre-releases / release candidates can be vulnerable and are different to official releases.
e.g. in case of axum-core there is vulnerability that affects
0.3.0-rc.1
where as0.3.0=rc.2
and future non-pre-release0.3.0
will be patched but cargo deny doesn't distinguish between pre-release and release.cargo deny does not flag 0.3.0-rc.1 as expected but at least it doesn't cause other side effects and does a warning of some sort:
cargo audit flags it correctly:
$ grep axum-core Cargo.toml; cargo audit -n
To Reproduce
Dummy crate that relies with release-candidate:
Then mock advisory with how we would mark it in advisory db:
Expected behavior
cargo deny should flag advisory on
0.3.0-rc.1
when patched is pinned= 0.3.0
and0.3.0-rc.1
has not been marked asunaffected
Additional context
I don't think we've added advisories that need to match pre-releases but worth an ask if cargo deny could support this I guess ?
Discussing here in depth what to do with pre-releases in general: rustsec/rustsec#690
The text was updated successfully, but these errors were encountered: