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

GHSA improperly consumes and re-publishes CVE version metadata #771

Open
daniel-beck opened this issue Oct 25, 2022 · 20 comments
Open

GHSA improperly consumes and re-publishes CVE version metadata #771

daniel-beck opened this issue Oct 25, 2022 · 20 comments

Comments

@daniel-beck
Copy link

Whatever process is used to create GitHub Security Advisories does not consume version ranges from CVE metadata properly.

This results, for example, in GHSA-g975-f26h-93g8 claiming that version 2.24.2 is affected, when https://github.com/CVEProject/cvelist/blob/9a1d65a12274643c9bad407acb8368f2b60d2b5c/2022/43xxx/CVE-2022-43408.json#L22-L25 specifically excludes it.

This creates a ton of unnecessary confusion for users and false positive security scan results, and should be fixed.

@darakian
Copy link
Contributor

Apologies about that. I've updated our advisory to reflect the CVE and I'll dig into what went wrong there. Thanks 👍

@daniel-beck
Copy link
Author

daniel-beck commented Oct 25, 2022

@darakian Thanks! To clarify, the above is an example of a very common problem for us, there are almost 100 more CVEs in which we exclude backports since 2020, and almost all of them are improperly represented in their corresponding GHSAs. I reviewed our CVE entries that specify backports as exclusions from the range and list the results below. I hope this review/feedback helps you identify possible problems in the GHSA process.

That said, after thinking about this a bit, I consider CVE JSON v4 as underspecified. It does not seem to specify the semantics of overlapping version specifiers/ranges, other than the example being

"Product X between versions 10.2 and 10.8"

which probably involves a >= and a <= range (but might be !> and !< with no inclusion range at all). To keep ranges reasonable, we interpret it as exclusions taking precedence over inclusions for our otherwise straightforward ranges. That way, our metadata doesn't have to look like GHSA-rvg5-f5fj-mxvg which could result in reading/comprehension issues. If we're indeed wrong about this, I would appreciate if you could point us to the documentation for this.

Review of GHSA 2020-2022

@darakian
Copy link
Contributor

darakian commented Oct 26, 2022

Hey @daniel-beck,

Ya digging into this we ignore the cve product versions as they are a. uncommon and b. under specified leading to them being an unreliable source of information. We're in the process of migrating to CVE JSON v5 as well so, I don't expect our v4 support to change anytime soon.

For that list of CVEs I've made an internal issue for us to re-review them. I'll update you here when we can process them. Many thanks for letting us know 👍

@KateCatlin
Copy link
Collaborator

Hi @daniel-beck,

Just an update to let you know this is still on our list to backfill! We continually improve our database and the Curation team are constantly running these types of campaigns. This one just hasn't made it to the top of our list yet.

Thanks for your patience!

@daniel-beck
Copy link
Author

daniel-beck commented Apr 3, 2023

All of GHSA-j664-qhh4-hpf8 GHSA-584m-7r4m-8j6v GHSA-rrgp-c2w8-6vg6 GHSA-hf9h-vv4m-2f33 GHSA-frgr-c5f2-8qhh GHSA-h76p-mc68-jv3p GHSA-cj6r-8pxj-5jv6 drop version exclusions defined in the original CVE JSON metadata, thereby improperly including (i.e. claiming to be affected) 2.387.x LTS releases of Jenkins.

It's not even the fault of CVE JSON v4 in this case, since there was no downconversion done by MITRE.

Bonus: Half of the entries don't have 2.375.4 as a fixed version despite the fix versions being identical for all of these.

@westonsteimel
Copy link

@daniel-beck does #2260 (comment) correct for CVE-2022-20613 or should version 1.34.2 be excluded as well? I didn't see 1.34.2 as excluded per the Jenkins announcement so have left it out for the moment

@daniel-beck
Copy link
Author

daniel-beck commented May 16, 2023

I didn't see 1.34.2 as excluded per the Jenkins announcement so have left it out for the moment

We currently do not mention backports that are irrelevant for most users in end user announcements for easier readability (it gets messy fast). For full version information, see the CVE metadata at cve.org.

@westonsteimel
Copy link

westonsteimel commented May 16, 2023

Okay thanks, I'll start working through updating these using the assumption that the NVD CPE cve.org info will be correct

@daniel-beck
Copy link
Author

Me:

Screenshot 2024-01-26 at 22 13 07

(Admittedly, the 2.440.x line was a late addition preparing for our upcoming stable line with the backport, so that being unmentioned is, right now, fine.)

GitHub:

Screenshot 2024-01-26 at 22 13 16

I cannot even begin to guess what's going on here.

@darakian
Copy link
Contributor

I cannot even begin to guess what's going on here.

Apologies about that. That was down to manual error on my part. I was reading from the NVD version of the CVE.
https://nvd.nist.gov/vuln/detail/CVE-2024-23897

Given that the LTS and regular releases are on the same maven artifact could I ask you for the affected ranges as opposed to the unaffected ranges?

@daniel-beck
Copy link
Author

daniel-beck commented Jan 29, 2024

@darakian Thanks for your response!

The reference you provided doesn't list any versions ranges other than the prose I wrote for the CVE description, so I guess you mean that? I left out the 1.606 start of range given its obsolescence, but considering 2.427 through 2.441 unaffected would be wrong based on that as well (if you read the version ranges as independent, which is how we describe them for admins), and is far more relevant to admins keeping things up to date.

could I ask you for the affected ranges as opposed to the unaffected ranges?

Unsure what you're asking. I'd prefer to keep the approach chosen for future CVEs, as the "affected" ranges look quite messy if you're unwilling to mix release lines. But for programmatic consumers, it looks fairly straightforward:

  • 1.606 through 2.426.2, both inclusive
  • 2.427 through 2.440, both inclusive
  • 2.441

(With the added problem that for another ~4 weeks or so there won't be a 2.440.1 fixed version.)

FWIW a similar problem exists for CVE-2024-23898 which has a different initial affected release but same fixed versions.

@darakian
Copy link
Contributor

The reference you provided doesn't list any versions ranges other than the prose I wrote for the CVE description, so I guess you mean that?

Yep. That plus me trying to make what I thought would be a sensible combined range. Again sorry about that. 😞

Unsure what you're asking. I'd prefer to keep the approach chosen for future CVEs, as the "affected" ranges look quite messy if you're unwilling to mix release lines.

The CVE record you linked had versions listed as unaffected and I was asking for the inverse. What you provided looks great.

(With the added problem that for another ~4 weeks or so there won't be a 2.440.1 fixed version.)

That's unfortunate. I've updated our record and left the fixed version off for the time being. Let me know if you'd rather I put 2.440.1 on early 👍

FWIW a similar problem exists for GHSA-53ph-2r2x-vqw8 which has a different initial affected release but same fixed versions.

Reading from https://www.cve.org/CVERecord?id=CVE-2024-23898 the initial version on that one should be 2.217 right?

@daniel-beck
Copy link
Author

That plus me trying to make what I thought would be a sensible combined range. Again sorry about that. 😞

No worries, was just really surprised about the lack of resemblance, especially as I was hoping CVE JSON v5's unambiguous version ranges (see previous conversation) would help with GHSA republishing. Thanks for the super quick followup 👍

Reading from https://www.cve.org/CVERecord?id=CVE-2024-23898 the initial version on that one should be 2.217 right?

Correct, 2.222.1 is part of that range by Maven rules.

@darakian
Copy link
Contributor

. No worries, was just really surprised about the lack of resemblance, especially as I was hoping CVE JSON v5's unambiguous version ranges (see previous conversation) would help with GHSA republishing. Thanks for the super quick followup 👍

Ya, it's a pretty manual process on our end and while we try to minimize errors they do pop up. This issue has the upside of exposing a gap in how we're ingesting cve 5.0 data as well though, so there's some positivity there. Happy to get to this quick too. Timezones working out 🎉

Ok, GHSA-53ph-2r2x-vqw8 is also updated now. No fix versions on that one either. Please let me know if I've typo'd 🙇

@daniel-beck
Copy link
Author

Thanks for the updates!

FWIW fix versions 2.426.3 and 2.442 exist today for both. 2.440.1 will also have the fix, to be released in February. Whether that means no fix versions recorded until then because you have to touch these again anyway is you to you.

@darakian
Copy link
Contributor

Went ahead and added 2.426.3 and 2.442. Should 2.440.1 be 2.441.1? 2.441 would come after 2.440.1 right?

@daniel-beck
Copy link
Author

@darakian

Went ahead and added 2.426.3 and 2.442.

Thanks!

2.441 would come after 2.440.1 right?

In terms of version math, yes. Stable lines and backports mean that "version later" ≠ "date later" however, which is why the split ranges.

Should 2.440.1 be 2.441.1?

The forthcoming 2.440.1 stable release is also the reason I split the second and third range.

For context if you're very bored, https://www.jenkins.io/download/lts/

Every 12 weeks, the community will pick one of the relatively recent releases by consensus and mark it as the baseline for the next "stable but older" release line. Let’s say this was version X. We’ll create a branch from X to produce stable but older patch releases of X.1, X.2, and X.3. Changes to this branch will be restricted to backported cherry-picked bug fixes from the trunk that are "battle-tested" — meaning those commits that have already been a part of a main line release for more than a week. There are 3 minor releases for a baseline published in four week cycles.

2.440 is a recent weekly release we chose to be the next LTS baseline. We'll backport the security fixes into 2.440.1.

See how much easier this is by just specifying what versions are unaffected as I do on cve.org? 😁

@darakian
Copy link
Contributor

I see. Would it make more sense to tell a user on the weekly release line to go to the next weekly rather than the next LTS though?

See how much easier this is by just specifying what versions are unaffected as I do on cve.org? 😁

Sorta no, but my brain is wired for affected versions so that's probably a me problem 😄
fwiw our system is also affected versions oriented as well hence the questions.

@daniel-beck
Copy link
Author

Would it make more sense to tell a user on the weekly release line to go to the next weekly rather than the next LTS though?

This is what we're doing, it's just that the pairs of (affected version range, fix version) in GHSA don't seem to map well to how we assign Jenkins versions. It seems either readable for humans, but not technically correct; or difficult to read, while programmatically consumable.

Our advisories skip some details (e.g., we didn't bother mentioning the release 1.606 from 2015 there) for easier consumption by administrators; while our CVE metadata is canonically correct and intended for programmatic consumption. Different content for different audiences, basically.

@darakian
Copy link
Contributor

darakian commented Feb 1, 2024

This is what we're doing, it's just that the pairs of (affected version range, fix version) in GHSA don't seem to map well to how we assign Jenkins versions.

Interesting. Ok, I'll have to rethink how we represent that on our side. We have a constraint where our "fixed" versions cannot be "lower" than the vulnerable version range.

Our advisories skip some details (e.g., we didn't bother mentioning the release 1.606 from 2015 there) for easier consumption by administrators; while our CVE metadata is canonically correct and intended for programmatic consumption. Different content for different audiences, basically.

Makes total sense to me. Write for your intended reader 😄

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

4 participants