Skip to content

Hardening: security, shell reliability, CI and docs (in parts) - #21

Merged
wized2 merged 4 commits into
mainfrom
improve/hardening
Nov 11, 2026
Merged

wized2 merged 4 commits into
mainfrom
improve/hardening

Conversation

@wized2

@wized2 wized2 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Latch hardening (0.7.0 → 0.8.0)

  • Part 1: shell injection fix (validated package names), real shell/su timeouts, Plugin API switch honored, tests
  • Part 2: HTTP GET action: http(s) only, host-only logs, always disconnects
  • Part 3: CI: Gradle cache, timeout, concurrency, PRs build stable only, apksigner check, fork-friendly signing
  • Part 4: README privacy fix (INTERNET is used only by HTTP GET), Plugin API docs, threat model, CHANGELOG, RELEASE_NOTES, version 0.8.0 / code 13

Merging to main and tagging v0.8.0 publishes a signed release. Needs the signing secrets on wized2/Latch.

wized2 and others added 4 commits November 11, 2026 14:02
…shell timeouts

- Force-stop built "am force-stop <pkg>" from rule text with no validation, so a
  rule (or an imported recipe) could inject shell commands. Names must now match a
  strict package-name pattern
- The "Plugin API" switch only gated outgoing broadcasts; the exported
  PluginReceiver ignored it, so any installed app could fire triggers or run rules
  even when the user had turned it off. It now checks the switch
- Elevated.drain read the process output to EOF before applying its timeout, so a
  hung su/sh blocked the caller forever; output is now read on a helper thread and
  the process is destroyed on timeout. hasSu() shares the same timeout and is cached
  for 30 s instead of spawning su on every call
- RuleLogic gains pure helpers (package name, http(s) URL, host-only log) with tests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBS1KApo9NfNebojzAwAS2
…connects

- startsWith("http") also accepted "httpfoo://"; only http:// and https:// are used now
- The run log stored the whole URL, including query-string tokens; it stores the host
- The connection is now closed in a finally block even when the request throws
- Rejected URLs are logged instead of silently ignored

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBS1KApo9NfNebojzAwAS2
…y signing

- PRs build only the stable release; branch and tag builds build everything
- Gradle cache (read-only on PRs), 40 min timeout, newer PR pushes cancel older runs
- Tag releases on wized2/Latch fail without signing secrets; forks fall back to debug signing
- apksigner verifies the APK whenever a release key is present
- Test reports are uploaded when the build fails

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBS1KApo9NfNebojzAwAS2
…el; bump to 0.8.0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KBS1KApo9NfNebojzAwAS2
@wized2
wized2 marked this pull request as ready for review November 11, 2026 16:51
@wized2
wized2 merged commit 722aeef into main Nov 11, 2026
1 check passed
@wized2
wized2 deleted the improve/hardening branch November 11, 2026 16:51
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.

1 participant