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

Abierto
#60 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
ios, rust
Área
mobile, security

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Rust
Estrellas
3.4k
Forks
224
Merge medio
34 min
PR fusionados (30 d)
2

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de claration/impactor

Todos los issues de claration/impactor

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.