Skip to content

Output/report formatting for uv audit#18193

Merged
woodruffw merged 2 commits intomainfrom
ww/uv-audit-results
Mar 10, 2026
Merged

Output/report formatting for uv audit#18193
woodruffw merged 2 commits intomainfrom
ww/uv-audit-results

Conversation

@woodruffw
Copy link
Copy Markdown
Member

@woodruffw woodruffw commented Feb 25, 2026

Summary

This adds some initial output/report formatting for uv audit.

This is an initial blush, any feedback to align this with rendering/formatting idioms elsewhere would be greatly appreciated!

Atop #18119.

Test Plan

None yet.

@woodruffw woodruffw changed the base branch from main to ww/uv-audit February 25, 2026 17:46
@woodruffw woodruffw changed the title Ww/uv audit results Output/report formatting for uv audit Feb 25, 2026
@woodruffw woodruffw mentioned this pull request Feb 25, 2026
10 tasks
@woodruffw
Copy link
Copy Markdown
Member Author

Example current output:

warning: `uv audit` is experimental and may change without warning. Pass `--preview-features audit` to disable this warning.
Resolved 71 packages in 29ms
Found 7 known vulnerabilities and no adverse project statuses in 71 packages

Vulnerabilities:

cryptography 46.0.3 has 1 known vulnerability:

- GHSA-r6ph-v2qm-q3c2: cryptography Vulnerable to a Subgroup Attack Due to Missing Subgroup Validation for SECT Curves

  Fixed in: 46.0.5


filelock 3.20.0 has 2 known vulnerabilities:

- GHSA-qmgc-5h2g-mvrw: filelock Time-of-Check-Time-of-Use (TOCTOU) Symlink Vulnerability in SoftFileLock

  Fixed in: 3.20.3

- GHSA-w853-jp5j-5j7f: filelock has a TOCTOU race condition which allows symlink attacks during lock file creation

  Fixed in: 3.20.1


jaraco-context 6.0.1 has 1 known vulnerability:

- GHSA-58pv-8j8x-9vj2: jaraco.context Has a Path Traversal Vulnerability

  Fixed in: 6.1.0


urllib3 2.5.0 has 3 known vulnerabilities:

- GHSA-2xpw-w6gg-jr37: urllib3 streaming API improperly handles highly compressed data

  Fixed in: 2.6.0

- GHSA-38jv-5279-wg99: Decompression-bomb safeguards bypassed when following HTTP redirects (streaming API)

  Fixed in: 2.6.3

- GHSA-gm62-xv2j-4w53: urllib3 allows an unbounded number of links in the decompression chain

  Fixed in: 2.6.0

Screencap with color:

image

@woodruffw woodruffw marked this pull request as ready for review February 26, 2026 21:48
@woodruffw woodruffw requested a review from konstin February 26, 2026 21:48
@woodruffw woodruffw force-pushed the ww/uv-audit branch 3 times, most recently from df8f860 to 233fd7f Compare March 2, 2026 18:57
woodruffw added a commit that referenced this pull request Mar 3, 2026
## Summary

This provides the scaffolding (CLI and initial `uv-audit` crate) for a
`uv audit` subcommand.

Closes #9189.

Tracking:

- [x] Core CLI scaffolding (this PR)
    - [x] #18185 
- [x] Audit core (probably a new `uv-audit` crate): #18124 
- [ ] Bulk dependency audits with OSV
- [ ] Result presentation
    - [ ] #18193 


Things that also need to be done with the MVP:

- [ ] We should not audit workspace members by default (by definition,
they don't exist on indices and therefore don't have meaningful results
from vulnerability services).
- [ ] I need to ensure groups/etc. are being filtered by correctly,
right now we audit every single package in the lockfile unconditionally.

## Test Plan

Unit and integration tests commensurate with the new functionality.

---------

Signed-off-by: William Woodruff <william@astral.sh>
Base automatically changed from ww/uv-audit to main March 3, 2026 16:11
@woodruffw woodruffw force-pushed the ww/uv-audit-results branch 3 times, most recently from f64784b to bba6e5a Compare March 3, 2026 16:16
@konstin konstin added the preview Experimental behavior label Mar 5, 2026
Copy link
Copy Markdown
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Code looks good, left some style comments.

@woodruffw woodruffw force-pushed the ww/uv-audit-results branch 3 times, most recently from b47913d to 237062b Compare March 5, 2026 18:00
@woodruffw woodruffw requested a review from konstin March 8, 2026 02:32
Copy link
Copy Markdown
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

Code looks good, is there an example uv.lock to see it in color?

@woodruffw
Copy link
Copy Markdown
Member Author

Code looks good, is there an example uv.lock to see it in color?

I was testing it locally against psf/cachecontrol (since I added a lockfile to that repo a while back).

)?;

for vuln in vulns {
writeln!(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we show the link too? The title often isn't enough to understand whether you are affected.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I'll do that with a follow-up!

woodruffw added a commit that referenced this pull request Mar 9, 2026
## Summary

Atop #18193.

This tweaks the baseline filtering we do with `uv audit` -- previously
we only skipped packages without versions, but we should _also_ skip
workspace members, since workspace members are local by definition.

## Test Plan

Will be tested with integration tests.

Signed-off-by: William Woodruff <william@astral.sh>
woodruffw added a commit that referenced this pull request Mar 9, 2026
## Summary

Atop #18193.

This tweaks the baseline filtering we do with `uv audit` -- previously
we only skipped packages without versions, but we should _also_ skip
workspace members, since workspace members are local by definition.

## Test Plan

Will be tested with integration tests.

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw force-pushed the ww/uv-audit-results branch from dc80a24 to 6246b49 Compare March 9, 2026 14:56
woodruffw added a commit that referenced this pull request Mar 9, 2026
Atop #18193.

This tweaks the baseline filtering we do with `uv audit` -- previously
we only skipped packages without versions, but we should _also_ skip
workspace members, since workspace members are local by definition.

Will be tested with integration tests.

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw force-pushed the ww/uv-audit-results branch from 6246b49 to c2553d1 Compare March 9, 2026 15:00
Signed-off-by: William Woodruff <william@astral.sh>

Skeleton AuditDisplay

Signed-off-by: William Woodruff <william@astral.sh>

Initial reporting for `uv audit`

Signed-off-by: William Woodruff <william@astral.sh>

More spacing

Signed-off-by: William Woodruff <william@astral.sh>

I curse the English language's irregular plural forms

Signed-off-by: William Woodruff <william@astral.sh>

Clippy

Signed-off-by: William Woodruff <william@astral.sh>

Bump snapshots

Signed-off-by: William Woodruff <william@astral.sh>

Feedback

Signed-off-by: William Woodruff <william@astral.sh>

Feedback

Signed-off-by: William Woodruff <william@astral.sh>

Add a TODO

Signed-off-by: William Woodruff <william@astral.sh>
Atop #18193.

This tweaks the baseline filtering we do with `uv audit` -- previously
we only skipped packages without versions, but we should _also_ skip
workspace members, since workspace members are local by definition.

Will be tested with integration tests.

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw force-pushed the ww/uv-audit-results branch from c2553d1 to 0333537 Compare March 9, 2026 15:24
@woodruffw woodruffw merged commit f54ce67 into main Mar 10, 2026
213 of 216 checks passed
@woodruffw woodruffw deleted the ww/uv-audit-results branch March 10, 2026 04:07
woodruffw added a commit that referenced this pull request Mar 10, 2026
## Summary

This adds links to `uv audit`'s outputs. This required adding links to
the backing (common) Vulnerability type and pulling them from the OSV
service. OSV will always produce a link for a Vulnerability (since the
ID itself can be turned into a link), but `Vulnerability::link` itself
is optional since other services may not necessarily guarantee this.

Follows #18193.

## Test Plan

None yet.

---------

Signed-off-by: William Woodruff <william@astral.sh>
@woodruffw woodruffw mentioned this pull request Mar 16, 2026
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants