Hooks met vaste p-registers controleren niet of de methode een instance-methode is #85
Labels
No labels
area/architecture
area/build-ci
area/bytecode
area/code-quality
area/docs
area/extension
area/fingerprint
area/security
area/tests
Bug report
Feature request
review
sev/low
sev/medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midas/midas-patches#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: medium · Categorie: bytecode · Effort: S
Probleem
Verschillende hooks in obfuscated, door R8 bewerkte methodes gebruiken vaste
p0,p1enp2: Kubus content filters, Kubus Hide ads, forced update, Kubus Midas Settings, en Edition Hide ads (p1als scratch). Dat klopt alleen zolang de methode een instance-methode is. De fingerprints pinnen geenaccessFlags. AGENTS.md waarschuwt zelf dat R8 een methode static kan maken.Waar
patches/src/main/kotlin/nl/midasvo/patches/kubus/contentfilters/ContentFilterPatches.kt#L46-59patches/src/main/kotlin/nl/midasvo/patches/kubus/ads/HideAdsPatch.kt#L64-69patches/src/main/kotlin/nl/midasvo/patches/kubus/forcedupdate/DisableForcedUpdatePatch.kt#L22-28patches/src/main/kotlin/nl/midasvo/patches/kubus/settings/MidasSettingsPatch.kt#L112-123patches/src/main/kotlin/nl/midasvo/patches/kubus/settings/Fingerprints.kt#L60-70patches/src/main/kotlin/nl/midasvo/patches/edition/ads/HideAdsPatch.kt#L55-73patches/src/main/kotlin/nl/midasvo/patches/edition/ads/Fingerprints.kt#L48-76Bewijs
U3-1 (patches/src/main/kotlin/nl/midasvo/patches/kubus/contentfilters/ContentFilterPatches.kt)
U2-5 (patches/src/main/kotlin/nl/midasvo/patches/edition/ads/HideAdsPatch.kt)
Impact
Wordt een methode static na een app-update, dan schuiven de argumentregisters één plek op. De hook assembleert dan niet, of hij leest of overschrijft stil het verkeerde argument. In het tweede geval geeft de patch
Applied:en gedraagt de app zich fout.Voorstel
Pin
AccessFlags(zonderSTATIC) in de fingerprints van deze hooks, of gooi eenPatchExceptionnaastrequireLocalRegistersals de methode static is. Leid het register waar mogelijk af metinvokeArgumentRegisterof uit het aantal parameters. Corrigeer het commentaar "p1 is the Context" in Edition Hide ads.Acceptatiecriteria
pNop een obfuscated methode gebruikt, faalt bij het patchen met een duidelijkePatchExceptionals de methode static is.Applied:op de huidige Edition- en Kubus-APK's.Code review @
33e02db(2026-10-14) · findings: U3-1, U2-5Opgelost in PR #120, gemerged in dev en uitgebracht in v1.10.0 (onderdeel van #105).