-
Notifications
You must be signed in to change notification settings - Fork 193
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
Getting a vuln's source URL #3046
Comments
Hi @nchelluri, sorry for missing that post! It looks like we do pull the database_specific source from the source link if it's there, but we haven't actually documented that anywhere. @oliverchang, what do you think? Do you think user can rely on this, and we document this somewhere? I also feel it will make more sense to place this |
This is indeed undocumented behaviour, but I don't think it's safe to continue to rely on this without any changes in the future unfortunately. This is because Relying on |
Ok, thank you; do you think it might be possible for osv.dev to publish the source as extracted by |
Unfortunately, we don't have any plans for this unless we see more demand. I will close this issue for now, but feel free to reopen it if you still have any other questions. Thanks! |
Discussed in #3045
Originally posted by nchelluri January 8, 2025
Hi, I am querying the osv.dev API and had a question about the
affected[].database_specific
field: https://ossf.github.io/osv-schema/#affecteddatabase_specific-field . What I really want is a single source field, for the vuln like I see in theaffected[0].database_specific.source
field here: https://api.osv.dev/v1/vulns/CVE-2024-38372 . The small handful of other vulns I have queried - from different databases and ecosystems - seem to all have this field present; as far as I can tell, it is a URL for the source of the vuln (and I think/hope it is the same value for all elements inaffected
).I wanted to know if I could depend on this behavior.
An alternative I thought of was that described here https://ossf.github.io/osv-schema/#id-modified-fields is a way to assemble the source URL. This is likely workable and I can do that. However, it would require me to maintain a list of the prefixes and databases and URL formats. I am using osv-scanner to query the API. I thought: maybe osv-scanner would have a tool to do that in-built, so that the maintainers could keep such a prefix, DB, and URL list up-to-date. But I don't see that facility in the code, unless I am missing it.
Can anyone advise me on how to proceed? I think if I might just copy whatever way the OSV website calculates the "Import Source" field (I think this is found in
source.yaml
) then I would likely be okay. But, the schema does say aboutaffected[].database_specific
:So I don't want to do the wrong thing and have my code break later.
Does anyone have any suggestions? Thank you!
The text was updated successfully, but these errors were encountered: