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

未关闭
#60 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
ios, rust
领域
mobile, security

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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
主要语言
Rust
星标
3.4k
派生
224
平均合并
34 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

claration/impactor 的其他 Issue

查看 claration/impactor 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。