Skip to content

Fixed failing apk handler test#4844

Open
MuneebUllahKhan222 wants to merge 1 commit intotrufflesecurity:mainfrom
MuneebUllahKhan222:INS-421
Open

Fixed failing apk handler test#4844
MuneebUllahKhan222 wants to merge 1 commit intotrufflesecurity:mainfrom
MuneebUllahKhan222:INS-421

Conversation

@MuneebUllahKhan222
Copy link
Copy Markdown
Contributor

@MuneebUllahKhan222 MuneebUllahKhan222 commented Mar 27, 2026

Description:

This PR fixes the failing APK handler test due to the deletion of an artifact that it uses.
To fix this I have re-uploaded the artifact to my public repo and used that in test.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Low Risk
Low risk: only updates a test fixture download URL, with no production code changes; remaining risk is continued dependence on an external GitHub-hosted asset for test stability.

Overview
Fixes a failing TestAPKHandler by updating the APK fixture download URL to a new GitHub-hosted location after the previous artifact was removed.

No runtime behavior changes; this only affects test setup and reliability.

Written by Cursor Bugbot for commit 547cf57. This will update automatically on new commits. Configure here.

@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team March 27, 2026 07:15
@MuneebUllahKhan222 MuneebUllahKhan222 requested review from a team as code owners March 27, 2026 07:15
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

}{
"apk_with_3_leaked_keys": {
archiveURL: "https://github.com/joeleonjr/leakyAPK/raw/refs/heads/main/aws_leak.apk",
archiveURL: "https://raw.githubusercontent.com/MuneebUllahKhan222/asset-hosting/refs/heads/main/aws_leak.apk",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test fetches APK from untrusted personal repository

Medium Severity

The test now downloads an APK binary from a personal GitHub account (MuneebUllahKhan222/asset-hosting) during CI. Any owner of that account can replace aws_leak.apk with arbitrary content at any time — a malicious APK could exploit parser vulnerabilities in the handler under test or in underlying zip/archive libraries. Additionally, this is identical in fragility to the original problem: if the repo is deleted or made private, the test breaks again. Test fixtures with sensitive-looking secrets should be stored in the project's own repository or a controlled, immutable artifact store.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is how we are going to do it for now. Later on we will have to store the artifact of a GCP bucket or Trufflehog's github repo.

Copy link
Copy Markdown
Contributor

@nabeelalam nabeelalam left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this issue @MuneebUllahKhan222. Approving this with one small change.

Can you also enable the test by removing the line:

t.Skip("[INS-421] - Skipping this test because the apk file being used in this test is unavailable")

Also, is this planned to be temporary? In that case leaving a comment would be helpful to indicate that this URL needs to be updated at some point.

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.

2 participants