[Bug] CoreTrust signed MachO's may not resign properly

Offen
#60 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
ios, rust
Bereich
mobile, security

Rechercherichtung

Start by reading the linked macho.rs code around lines 298–358, which detects data after a Mach-O signature, and inspect how Impactor invokes the codesigner. Reproduce the failure with the affected IPA the reporter offered to provide, then trace how CoreTrust-signed binaries differ from the current signing rules. Done means the affected app can be resigned without being rejected as a malformed Mach-O; the issue does not name a test or establish the expected handling of trailing data.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug help wanted
Report

The codesigner has specific rules to follow and this is one of them:

// Rules:
//
// 1. If there is an existing signature, there must be no data in
//    the binary after it. (We don't know how to update references to
//    other data to reflect offset changes.)
// 2. If there isn't an existing signature, there must be "room" between
//    the last load command and the first section to write a new load
//    command for the signature.

Some coretrust signed machos dont follow these rules and have data after them after the existing signature, causing the codesigner to fail and deem it as a malformed macho, @iosdecrypt telegram bot produces apps that evidently cause this error:

Err(AppleCodesignError::DataAfterSignature) "__LINKEDIT segment contains data after signature"
https://github.com/indygreg/apple-platform-rs/blob/main/apple-codesign/src/macho.rs#L298-L358

Contributor Checks
  • I am willing to attempt to make a pull request to fix this bug
Additional Information
  • Developer mode enabled
  • Using paid developer account
  • I will send an ipa of the app I'm having trouble installing if any
  • I'm willing to provide crash logs or debugging information if needed
Vorherrschende Sprache
Rust
Sterne
3.4k
Forks
224
Ø Merge
34 Min.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus claration/impactor

Alle Issues in claration/impactor

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.