Skip to content

Add stealth leakage checks#8776

Closed
reflog wants to merge 1 commit into
mainfrom
stealth/8766-leakage-checks
Closed

Add stealth leakage checks#8776
reflog wants to merge 1 commit into
mainfrom
stealth/8766-leakage-checks

Conversation

@reflog
Copy link
Copy Markdown
Contributor

@reflog reflog commented May 15, 2026

Summary

  • add a stdlib scanner for APK/AAB, ZIP-like archives, and unpacked stealth build output
  • add forbidden-token categories for Lantern identity, VPN UI strings, OAuth, billing, app links, social URLs, update URLs, and stricter stealth-novpn VPN/TUN surfaces
  • add safe Make and opt-in Android CI entry points plus usage docs

Tests

  • python3 -m unittest scripts/stealth/check_leakage_test.py
  • python3 -m py_compile scripts/stealth/check_leakage.py scripts/stealth/check_leakage_test.py
  • make stealth-leakage-check
  • scripts/stealth/check_leakage.py --list-modes
  • git diff --cached --check

Closes getlantern/engineering#3570

Copilot AI review requested due to automatic review settings May 15, 2026 12:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Python-based stealth leakage scanner and integrates it into Android build tooling to detect forbidden Lantern/VPN/billing/OAuth/update identifiers in stealth artifacts.

Changes:

  • Adds forbidden-token configuration and a stdlib scanner for files, directories, and ZIP-like Android artifacts.
  • Adds unit tests and Make targets for default stealth and stricter no-VPN scans.
  • Adds documentation and an optional Android workflow input/step for running leakage checks in CI.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/stealth/forbidden_tokens.json Defines forbidden token categories and stealth scan modes.
scripts/stealth/check_leakage.py Implements the leakage scanner CLI and archive/directory scanning logic.
scripts/stealth/check_leakage_test.py Adds unit tests for token detection, archive scanning, allowlists, modes, and missing targets.
Makefile Adds configurable stealth leakage check targets.
docs/stealth-leakage-checks.md Documents usage, modes, and allowlist format.
.github/workflows/build-android.yml Adds optional workflow input and CI step for leakage checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +312 to +315
if is_archive_name(path.name) and zipfile.is_zipfile(path):
self.scan_archive_file(path, logical, depth=0)
else:
self.scan_bytes(logical, path.read_bytes())
Comment on lines +164 to +166
- name: Stealth leakage check
if: ${{ inputs.stealth_leakage_mode != '' }}
run: make stealth-leakage-check
@reflog
Copy link
Copy Markdown
Contributor Author

reflog commented May 15, 2026

Superseded by #8777, which contains the validated stealth leakage-check implementation.

@reflog reflog closed this May 15, 2026
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