Fix critical false negative in check command on first run#6
Closed
Mehran-Seifalinia wants to merge 1 commit into
Closed
Fix critical false negative in check command on first run#6Mehran-Seifalinia wants to merge 1 commit into
check command on first run#6Mehran-Seifalinia wants to merge 1 commit into
Conversation
- Add index readiness check before performing package checks - If no successful sync yet, wait for background index download using WaitBackgroundSync() - Prevents returning "clean" or "not_found" while index is still downloading
Neo - PR Security ReviewNo security issues found Comment |
Neo - PR Security ReviewNo security issues found Comment |
Author
|
@pdneo review |
ehsandeep
reviewed
Jun 13, 2026
ehsandeep
left a comment
Member
There was a problem hiding this comment.
Hey, Thanks for PR, but I'm unabel to reproduce what you reported, can you share more details?
$ rm -rf ~/.cache/depx
$ depx apkeep
__
____╱ ╱__ ____ _ __
╱ __ ╱ _ ╲╱ __ ╲│ │╱_╱
╱ ╱_╱ ╱ __╱ ╱_╱ ╱> <
╲__,_╱╲___╱ .___╱_╱│_│
╱_╱ v0.1.0
[MAL-2026-3431] MALICIOUS · apkeep (PyPI) · 32d
↳ Package: https://pypi.org/project/apkeep/
↳ OSV: https://osv.dev/vulnerability/MAL-2026-3431
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a critical false negative in the
checkcommand (and default invocation) on the very first run after installation or cache clearance.Problem
When a user runs
depx check <package>for the first time (no existing local index), the command does not wait for the malicious‑package index to finish downloading. Instead, it immediately queries theintelProvider, which may returnnot_foundorcleanbecause the background sync is still in progress.Impact: A package that is actually malicious can be reported as safe (false negative). This undermines supply‑chain security in CI/CD pipelines and local audits.
Why it wasn't caught: Existing e2e tests always prime the cache via
searchorfeedbefore testingcheck. No test covers a cold‑cachecheckinvocation.Solution
Add an explicit readiness check before creating the
check.Service:intelProvider.SyncStatus().LastSuccess.IsZero()(no successful sync yet), show a spinner "Downloading malicious package index…" and block onintelProvider.WaitBackgroundSync()until the index is fully downloaded.Changes:
cli/check.go– insert the readiness block right after the advisory‑ID branch and beforecheck.NewService.