Fixed dependency warnings stay open when the upgrade is in a version catalog, Directory.Packages.props, Package.resolved and similar files

Đang mở
#3 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, typescript
Lĩnh vực
devtools, security

Hướng nghiên cứu

Start with isDependencyManifest in packages/engine/src/scan/fixcheck.ts and compare its list with the formats the indexer reads in crates/indexer/src/deps/formats.rs. The consumers are affectedFindings in apps/web/src/server/scans.ts and changesDependencies in apps/web/src/server/webhooks.ts. Done means the missing files (libs.versions.toml, Package.resolved, pdm.lock, .gitmodules and the others listed) are recognised, and a test fails if the indexer gains a format the check does not know about.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi! I found a gap between what Sandchest reads and what it watches.

What happens

When I upgrade a vulnerable library in some dependency files, Sandchest doesn’t notice the upgrade. The warning stays open even though the problem is fixed, and the CVE directory keeps the old version.

Why

The indexer reads dependencies from these files (crates/indexer/src/deps/formats.rs). But isDependencyManifest in packages/engine/src/scan/fixcheck.ts decides whether a push “changed dependencies”, and its list is shorter. So when a push only touches one of the missing files:

affectedFindings (apps/web/src/server/scans.ts) skips re-checking the open vulnerable_dependency findings.
changesDependencies (apps/web/src/server/webhooks.ts) skips refreshing the dependency inventory.

Files the indexer reads but the check misses

libs.versions.toml (Gradle version catalogs, common in Android/Kotlin)
Directory.Packages.props, packages.config, *.fsproj, .vbproj (.NET)
Package.resolved (Swift)
pdm.lock (Python)
rebar.lock (Erlang), Manifest.toml (Julia), renv.lock (R)
cabal.project.freeze, stack.yaml.lock (Haskell), opam.locked (OCaml)
.gitmodules, .github/workflows/
.yml

Steps to reproduce

Use a Gradle project that keeps versions in gradle/libs.versions.toml, with a library that has a known CVE.
Let Sandchest report the vulnerable dependency.
Push a commit that only bumps that library’s version in libs.versions.toml.
The finding stays open.

Expected

Any file the indexer reads dependencies from should count as a dependency change.

Suggested fix

Add the missing file names to isDependencyManifest. Also add a test that lists every file the indexer supports, so the two lists can’t drift apart again.

Happy to open a PR for this if it sounds good.

Ngôn ngữ chính
TypeScript
Star
57
Fork
8
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.