Skip to content

Conversation

khorben
Copy link

@khorben khorben commented Apr 23, 2024

This is relevant to FreeBSD's ports, and possibly to any other project using the VuXML format in order to track vulnerabilities. (http://vuxml.freebsd.org)

The objective is to help FreeBSD offer security advisories in the OSV format, for ports first but possibly also for base components in the future. The corresponding ecosystem string (most likely FreeBSD) will be requested in a dedicated pull request.

Sponsored by: The FreeBSD Foundation

@khorben khorben marked this pull request as ready for review October 15, 2024 15:06
@andrewpollock
Copy link
Collaborator

Hi @khorben, this is exciting progress. I can review this from the OSV side of things, is there a VuXML SME who can review that side of things?

Also, if you look at tools/redhat for inspiration, having some test data to validate behaviour is also helpful.

@khorben
Copy link
Author

khorben commented May 2, 2025

Hi Andrew, sorry for the late answer. I suppose by SME you meant "Subject Matter Expert", in which case I think FreeBSD's ports-secteam@ (https://wiki.freebsd.org/PortsSecteam) might be the best point of contact.
I am looking into importing some test data for validation.

@khorben khorben force-pushed the khorben/vuxml branch 3 times, most recently from 4bd95a4 to 8614a9b Compare May 3, 2025 01:01
@andrewpollock
Copy link
Collaborator

Would you mind addressing the DCO check failure?

Copy link
Collaborator

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by the UBUNTU-CVE-2025-3454 test files?

I think it'll be a no-op change, but it'd be good to update the schema version in the test OSV records to the current version.

@khorben khorben force-pushed the khorben/vuxml branch 2 times, most recently from 3e0b468 to d3c580a Compare May 12, 2025 17:50
@khorben
Copy link
Author

khorben commented May 12, 2025

Would you mind addressing the DCO check failure?

Thanks for the heads up, I think this should be addressed now.

@khorben
Copy link
Author

khorben commented May 12, 2025

I'm confused by the UBUNTU-CVE-2025-3454 test files?

I have organised the test data as follows:

  • testdata/VUXML contains the original VUXML files, and their converted output into OSV's JSON
  • testdata/OSV is the other way around
    Should I change or clarify anything in the commits?

khorben added 4 commits May 12, 2025 23:39
This is relevant to FreeBSD's ports.

Note that:

* There is no official ecosystem for FreeBSD ports yet
* A few elements of the VuXML DTD are not covered (e.g., \<uscertsa>,
  \<uscertta>)
* Cancelled VuXML events are not represented, for lack of information
  (withdrawal date...)
* Some versions do not match reality and need a correct increment
  (\<gt>)

Sponsored by:	The FreeBSD Foundation

Signed-off-by: Pierre Pronchery <[email protected]>
This is relevant to FreeBSD's ports.

Sponsored by:	The FreeBSD Foundation

Signed-off-by: Pierre Pronchery <[email protected]>
XXX this only happens when outputting to the standard output.

This is relevant to FreeBSD's ports.

Sponsored by:	The FreeBSD Foundation

Signed-off-by: Pierre Pronchery <[email protected]>
This is relevant to FreeBSD's ports.

Sponsored by:	The FreeBSD Foundation

Signed-off-by: Pierre Pronchery <[email protected]>
@khorben
Copy link
Author

khorben commented May 12, 2025

I'm confused by the UBUNTU-CVE-2025-3454 test files?

Oh do you mean that you expected test files about FreeBSD?

First, IIRC VuXML is distribution-agnostic, and not tied to a specific ecosystem.
The FreeBSD project does not provide OSV files (yet); the objective is to allow the project to do so in the future; this is currently being investigated. OTOH, it can already be useful to import OSV data from other projects, and to publish it as VuXML fort the FreeBSD ports after review.

Likewise, it can be useful to convert VuXML data into OSV for the preparation work mentioned above. However, this still requires the corresponding ecosystem for FreeBSD, and choosing its exact name(s) might still be tricky: there is the base system, to distinguish from the third-party ports, and soon also from the packages for the base system.

I think it'll be a no-op change, but it'd be good to update the schema version in the test OSV records to the current version.

I have now updated the schema version in the output to OSV as 1.7.0.
I believe this is now as expected; let me know otherwise.

@illuusio
Copy link

illuusio commented May 14, 2025

When turning off DTD validation then it works (dtd_validation=False) with: https://vuxml.freebsd.org/freebsd/vuln.xml

if len(args) != 1:
return usage()

parser = etree.XMLParser(dtd_validation=True)
Copy link

@illuusio illuusio May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is True then it does not work:

  File "/somewhere/osv-schema/tools/vuxml/convert_vuxml.py", line 339, in <module>
    sys.exit(main())
             ^^^^^^
  File "/somewhere/osv-schema/tools/vuxml/convert_vuxml.py", line 127, in main
    tree = etree.parse(args[0], parser)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3590, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1958, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1984, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1887, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1200, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError
  File "vuln.xml", line 26
lxml.etree.XMLSyntaxError: failed to load "http:/www.vuxml.org/dtd/vuxml-1/vuxml-11.dtd": Attempt to load network entity, line 26, column 3

@illuusio
Copy link

I would also add purl for packages when ecosystem have package manager it's nice addition to information

@illuusio
Copy link

illuusio commented May 14, 2025

When Output directory is issued then (if I understand correctly) naming should something like: FBSD-2025-05-14.json or FBSD-VUID.json. My humble opinion is that they should be arranged by package name or yearly so there should not be so much in one dir.

@illuusio
Copy link

It seems that <affects> is right next to <topic> in FreeBSD VuXML-file. It shouldn't affect anything but if parser is very bad then it does not work.

@@ -0,0 +1,271 @@
#!/usr/bin/env python
#

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just suggesting to have SPDX-header for license also

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion, I have now added the SPDX headers.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPDX header seems to be correct

Sponsored by:	The FreeBSD Foundation

Signed-off-by: Pierre Pronchery <[email protected]>
Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you very much for working on this, and for adding the tests! (and apologies for the delay in reviewing)

@@ -0,0 +1,42 @@
{
"schema_version": "1.7.0",
"id": "409206f6-25e6-11f0-9360-b42e991fc52e",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to have a FREEBSD- or some other prefix so it's clear it comes from the FreeBSD database.

Please also define the chosen prefix in https://ossf.github.io/osv-schema/#id-modified-fields

"affected": [
{
"package": {
"ecosystem": "FreeBSD:ports",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a separate PR, could you please add a ecosystem definition to https://ossf.github.io/osv-schema/#affectedpackage-field ?

},
"ranges": [
{
"type": "SEMVER",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: does FreeBSD follow strict Semver 2.0 per https://semver.org/ and all its ordering rules?

If not, "ECOSYSTEM" would be the more accurate type.

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

Successfully merging this pull request may close these issues.

4 participants