Skip to content

Fix cargo-audit: upgrade h2 and git2 - #162

Merged
Ibrahimrahhal merged 2 commits into
mainfrom
cursor/fix-dep-audit-h2-git2-8cc6
Aug 26, 2026
Merged

Fix cargo-audit: upgrade h2 and git2#162
Ibrahimrahhal merged 2 commits into
mainfrom
cursor/fix-dep-audit-h2-git2-8cc6

Conversation

@Ibrahimrahhal

@Ibrahimrahhal Ibrahimrahhal commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

CI ./harness ci was failing on Dep audit because h2 0.4.12 is vulnerable to RUSTSEC-2026-0258 (unbounded empty HTTP/2 DATA frames). The same scan also reported two allowed unsound warnings on git2 0.20.4.

This change:

  • Upgrades the transitive h2 crate from 0.4.12 to 0.4.19 (patched >= 0.4.16) via Cargo.lock.
  • Upgrades the direct git2 dependency from 0.20.4 to 0.21.0, which patches RUSTSEC-2026-0183 and RUSTSEC-2026-0184.
  • Adapts callers to git2 0.21 string accessors (shorthand, url, StatusEntry::path) that now return Result instead of Option.
  • Adds a unit test that lists untracked files through StatusEntry::path.

default-features = false is unchanged; this crate does not use git2 SSH/HTTPS transports.

Test plan

  • cargo audit reports no vulnerabilities and no remaining git2 unsound warnings
  • cargo test — 747 passed, 0 failed (git2-backed get_repo_info*, git:untracked, scan include-image, HTTP/e2e paths that pull in h2 via hyper/reqwest)
  • cargo clippy --all-targets -- -D warnings and cargo fmt --check
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 26, 2026 06:52
Bump the transitive h2 crate to 0.4.19 to close RUSTSEC-2026-0258
(unbounded empty DATA frames). Upgrade git2 to 0.21 so the unsound
Remote::list and BlameHunk Signature APIs are patched, and adapt
callers to the 0.21 string-accessor Result types.

Co-authored-by: Ibrahim Rahhal <ibrahim.rahhal3636@gmail.com>
git2 0.21 changed StatusEntry::path from Option to Result. Exercise the
untracked-file listing path so that API change stays covered.

Co-authored-by: Ibrahim Rahhal <ibrahim.rahhal3636@gmail.com>
@Ibrahimrahhal
Ibrahimrahhal marked this pull request as ready for review August 26, 2026 06:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No actionable findings.

Verified that all three git2 0.21 accessor adaptations preserve the prior behavior for non-UTF-8 values, while default-features = false keeps the transport feature set unchanged. The lockfile contains a single h2 0.4.19 through Hyper and git2 0.21.0 with libgit2 1.9.7; cargo audit scanned all 316 dependencies with no advisories. Clippy, formatting, and all 748 local tests pass, including the new untracked-path test, and the PR’s full native-binary/CI platform matrix is green.

Open in Web View Automation 

Sent by Cursor Automation: pr-flow

@corgea-security corgea-security added the dennis-reviewed Dennis completed an automated review label Aug 26, 2026

@corgea-security corgea-security left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review risk: 1/5.

Low-risk git2 dependency upgrade with correct API adaptations that preserve prior handling of non-UTF-8 values. The added test covers untracked worktree path discovery. No actionable findings.

No critical or high-priority changes were found.

@corgea-security corgea-security left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved by Dennis: high policy risk and automated risk 1/5.

@Ibrahimrahhal
Ibrahimrahhal merged commit d7ff670 into main Aug 26, 2026
20 checks passed
@Ibrahimrahhal
Ibrahimrahhal deleted the cursor/fix-dep-audit-h2-git2-8cc6 branch August 26, 2026 07:23
cursor Bot pushed a commit that referenced this pull request Aug 26, 2026
Resolves Cargo.lock in main's favour: #162 upgraded h2 and git2 together,
superseding the h2-only bump on this branch.

git2 0.21 changed Reference::symbolic_target to Result<Option<&str>, Error>,
so default_branch unwraps both layers. #161 removed RepoInfo::status_dirty
and made .dirty mean what git status reports; the incremental gate already
read .dirty only, so it now refuses exactly the trees a user can see are
dirty.

Co-authored-by: ibrahim <ibrahim@corgea.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dennis-reviewed Dennis completed an automated review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants