blint 3.2.2__tar.gz → 3.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. {blint-3.2.2 → blint-3.2.3}/PKG-INFO +2 -2
  2. {blint-3.2.2 → blint-3.2.3}/README.md +1 -1
  3. blint-3.2.3/blint/data/annotations/review_ios_fingerprint.yml +98 -0
  4. blint-3.2.3/blint/data/annotations/review_ios_masvs.yml +133 -0
  5. blint-3.2.3/blint/data/annotations/review_ios_privacy_access.yml +34 -0
  6. blint-3.2.3/blint/data/annotations/review_ios_privacy_posture.yml +76 -0
  7. blint-3.2.3/blint/data/annotations/review_ios_sidechannel.yml +81 -0
  8. {blint-3.2.2 → blint-3.2.3}/blint/lib/analysis.py +12 -12
  9. {blint-3.2.2 → blint-3.2.3}/blint/lib/binary.py +129 -1
  10. blint-3.2.3/blint/lib/ios.py +428 -0
  11. {blint-3.2.2 → blint-3.2.3}/blint/lib/macho_objc.py +113 -19
  12. {blint-3.2.2 → blint-3.2.3}/blint/lib/runners.py +5 -1
  13. {blint-3.2.2 → blint-3.2.3}/blint/lib/sbom.py +270 -2
  14. {blint-3.2.2 → blint-3.2.3}/blint/lib/utils.py +16 -5
  15. {blint-3.2.2 → blint-3.2.3}/pyproject.toml +1 -1
  16. blint-3.2.2/blint/lib/ios.py +0 -169
  17. {blint-3.2.2 → blint-3.2.3}/LICENSE +0 -0
  18. {blint-3.2.2 → blint-3.2.3}/blint/__init__.py +0 -0
  19. {blint-3.2.2 → blint-3.2.3}/blint/cli.py +0 -0
  20. {blint-3.2.2 → blint-3.2.3}/blint/config.py +0 -0
  21. {blint-3.2.2 → blint-3.2.3}/blint/cyclonedx/README.md +0 -0
  22. {blint-3.2.2 → blint-3.2.3}/blint/cyclonedx/__init__.py +0 -0
  23. {blint-3.2.2 → blint-3.2.3}/blint/cyclonedx/spdx.py +0 -0
  24. {blint-3.2.2 → blint-3.2.3}/blint/cyclonedx/spec.py +0 -0
  25. {blint-3.2.2 → blint-3.2.3}/blint/data/__init__.py +0 -0
  26. {blint-3.2.2 → blint-3.2.3}/blint/data/android-services.json +0 -0
  27. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/__init__.py +0 -0
  28. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_apple_local_privesc_mie.yml +0 -0
  29. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_entries_generic.yml +0 -0
  30. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_entries_pe.yml +0 -0
  31. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_exe_go.yml +0 -0
  32. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_functions_generic.yml +0 -0
  33. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_imports_pe.yml +0 -0
  34. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_methods_android.yml +0 -0
  35. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_methods_generic.yml +0 -0
  36. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_methods_mips.yml +0 -0
  37. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_methods_pe.yml +0 -0
  38. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_monero_generic.yml +0 -0
  39. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_monero_go.yml +0 -0
  40. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_monero_rust.yml +0 -0
  41. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_rootkits_win.yml +0 -0
  42. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_rpc_win.yml +0 -0
  43. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_symbols_antiforensic.yml +0 -0
  44. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_symbols_generic.yml +0 -0
  45. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_symbols_hooka.yml +0 -0
  46. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_symbols_macho.yml +0 -0
  47. {blint-3.2.2 → blint-3.2.3}/blint/data/annotations/review_symbols_rust.yml +0 -0
  48. {blint-3.2.2 → blint-3.2.3}/blint/data/rules.yml +0 -0
  49. {blint-3.2.2 → blint-3.2.3}/blint/data/trackers.json +0 -0
  50. {blint-3.2.2 → blint-3.2.3}/blint/db.py +0 -0
  51. {blint-3.2.2 → blint-3.2.3}/blint/lib/__init__.py +0 -0
  52. {blint-3.2.2 → blint-3.2.3}/blint/lib/android.py +0 -0
  53. {blint-3.2.2 → blint-3.2.3}/blint/lib/android_services.py +0 -0
  54. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/__init__.py +0 -0
  55. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/algorithms.py +0 -0
  56. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/api.py +0 -0
  57. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/canon.py +0 -0
  58. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/command.py +0 -0
  59. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/fingerprint.py +0 -0
  60. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/match.py +0 -0
  61. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/model.py +0 -0
  62. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph/rusi.py +0 -0
  63. {blint-3.2.2 → blint-3.2.3}/blint/lib/callgraph_kpi.py +0 -0
  64. {blint-3.2.2 → blint-3.2.3}/blint/lib/checks.py +0 -0
  65. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik.py +0 -0
  66. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik_callgraph.py +0 -0
  67. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik_cfg.py +0 -0
  68. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik_dataflow.py +0 -0
  69. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik_review.py +0 -0
  70. {blint-3.2.2 → blint-3.2.3}/blint/lib/dalvik_semantics.py +0 -0
  71. {blint-3.2.2 → blint-3.2.3}/blint/lib/disassembler.py +0 -0
  72. {blint-3.2.2 → blint-3.2.3}/blint/lib/function_reviews.py +0 -0
  73. {blint-3.2.2 → blint-3.2.3}/blint/lib/indicators.py +0 -0
  74. {blint-3.2.2 → blint-3.2.3}/blint/lib/review_runner.py +0 -0
  75. {blint-3.2.2 → blint-3.2.3}/blint/lib/review_utils.py +0 -0
  76. {blint-3.2.2 → blint-3.2.3}/blint/logger.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blint
3
- Version: 3.2.2
3
+ Version: 3.2.3
4
4
  Summary: Linter and SBOM generator for binary files.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -76,7 +76,7 @@ blint is a tool for reverse engineers, security analysts, and developers to quic
76
76
  - Navigate to the [disassembly guide](./docs/DISASSEMBLE.md).
77
77
  - For callgraph internals and analyst-facing interpretation, see the [callgraph guide](./docs/CALLGRAPH.md).
78
78
  - **Android Deep Analysis:** In deep mode blint parses the dex classes, detects bundled service and tracker SDKs, and runs a Dalvik behavioural review that decodes the bytecode and flags risky behaviours such as dynamic code loading, reflection, native command execution, weak cryptography, and cleartext networking. The findings are attached to the BOM as custom properties. When disassembly is enabled, blint also writes a Dalvik callgraph sidecar next to the BOM.
79
- - **iOS/macOS App Analysis:** Point blint at an `.ipa` and it unpacks the app bundle, reads the `Info.plist` context (bundle id, version, minimum OS, FairPlay encryption status), and analyzes the main executable along with every embedded framework, dylib, and app extension. For Mach-O binaries, blint recovers Objective-C metadata (classes, superclasses, methods, protocols, and referenced selectors) and demangles Swift symbols, then surfaces iOS privacy capabilities such as location, camera, microphone, contacts, photos, telephony, motion, biometrics, and device fingerprinting.
79
+ - **iOS/macOS App Analysis:** Point blint at an `.ipa` and it unpacks the app bundle, reads the `Info.plist` context (bundle id, version, minimum OS, FairPlay encryption status), and analyzes the main executable along with every embedded framework, dylib, and app extension. For Mach-O binaries, blint recovers Objective-C metadata (classes, superclasses, methods, protocols, and referenced selectors) and demangles Swift symbols, then surfaces iOS privacy capabilities such as location, camera, microphone, contacts, photos, telephony, motion, biometrics, and device fingerprinting. It also reports privacy and fingerprinting behaviours — passive device fingerprinting, installed-app probing, local-network scanning, cross-app tracking, and the app's `PrivacyInfo.xcprivacy` posture including undeclared "required reason" API usage.
80
80
  - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
81
81
  - Includes cluster-style behavioral reviews for low-level networking patterns (for example eBPF sock_ops usage, TUN interception stacks, raw packet injection primitives, and local DoH redirection indicators).
82
82
  - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
@@ -30,7 +30,7 @@ blint is a tool for reverse engineers, security analysts, and developers to quic
30
30
  - Navigate to the [disassembly guide](./docs/DISASSEMBLE.md).
31
31
  - For callgraph internals and analyst-facing interpretation, see the [callgraph guide](./docs/CALLGRAPH.md).
32
32
  - **Android Deep Analysis:** In deep mode blint parses the dex classes, detects bundled service and tracker SDKs, and runs a Dalvik behavioural review that decodes the bytecode and flags risky behaviours such as dynamic code loading, reflection, native command execution, weak cryptography, and cleartext networking. The findings are attached to the BOM as custom properties. When disassembly is enabled, blint also writes a Dalvik callgraph sidecar next to the BOM.
33
- - **iOS/macOS App Analysis:** Point blint at an `.ipa` and it unpacks the app bundle, reads the `Info.plist` context (bundle id, version, minimum OS, FairPlay encryption status), and analyzes the main executable along with every embedded framework, dylib, and app extension. For Mach-O binaries, blint recovers Objective-C metadata (classes, superclasses, methods, protocols, and referenced selectors) and demangles Swift symbols, then surfaces iOS privacy capabilities such as location, camera, microphone, contacts, photos, telephony, motion, biometrics, and device fingerprinting.
33
+ - **iOS/macOS App Analysis:** Point blint at an `.ipa` and it unpacks the app bundle, reads the `Info.plist` context (bundle id, version, minimum OS, FairPlay encryption status), and analyzes the main executable along with every embedded framework, dylib, and app extension. For Mach-O binaries, blint recovers Objective-C metadata (classes, superclasses, methods, protocols, and referenced selectors) and demangles Swift symbols, then surfaces iOS privacy capabilities such as location, camera, microphone, contacts, photos, telephony, motion, biometrics, and device fingerprinting. It also reports privacy and fingerprinting behaviours — passive device fingerprinting, installed-app probing, local-network scanning, cross-app tracking, and the app's `PrivacyInfo.xcprivacy` posture including undeclared "required reason" API usage.
34
34
  - **Capability Analysis:** Identifies potentially sensitive capabilities by reviewing imported functions and symbols, such as network access, filesystem operations, or cryptographic API usage.
35
35
  - Includes cluster-style behavioral reviews for low-level networking patterns (for example eBPF sock_ops usage, TUN interception stacks, raw packet injection primitives, and local DoH redirection indicators).
36
36
  - **CI/CD Integration:** Can be added to build pipelines to enforce security policies, such as requiring code signing on all release artifacts.
@@ -0,0 +1,98 @@
1
+ ---
2
+ text: Device fingerprinting surface review for iOS/macOS Mach-O binaries
3
+ group: SYMBOL_REVIEWS
4
+ exe_type: MachO
5
+ binary_type: MachO
6
+ rules:
7
+ - id: IOS_PLATFORM_IDENTIFIER
8
+ title: Low-level platform identifier read
9
+ summary: Reads a Low-Level Platform Identifier
10
+ category: privacy-fingerprint
11
+ severity: info
12
+ description: |
13
+ The binary reads low-level identifiers that stay constant across launches:
14
+ the IOKit platform UUID/serial number or the kernel host name. Unlike the
15
+ vendor identifier, these are not reset by app removal and provide durable
16
+ device recognition that does not require any permission.
17
+ patterns:
18
+ - IOPlatformUUID
19
+ - IOPlatformSerialNumber
20
+ - kern.hostname
21
+ - gethostname
22
+ - id: IOS_DEVICE_ATTESTATION
23
+ title: Device attestation / persistent device state
24
+ summary: Uses Device Attestation
25
+ category: privacy-fingerprint
26
+ severity: info
27
+ description: |
28
+ The binary uses DeviceCheck (DCDevice) or App Attest
29
+ (DCAppAttestService). DeviceCheck persists a small amount of per-device
30
+ state that survives app reinstalls and factory resets, which can be used
31
+ for fraud detection but also for durable device recognition. Its presence
32
+ is worth noting in a privacy review.
33
+ patterns:
34
+ - DCAppAttestService
35
+ - DCDevice
36
+ - generateAssertion
37
+ - attestKey
38
+ - id: IOS_HARDWARE_FINGERPRINT
39
+ title: Low-level hardware fingerprinting
40
+ summary: Fingerprints Device Hardware
41
+ category: privacy-fingerprint
42
+ severity: info
43
+ description: |
44
+ The binary queries low-level hardware and system attributes through sysctl
45
+ and the GPU/Metal stack (model identifier, CPU type, GPU name and feature
46
+ set). Individually innocuous, combined these attributes form a stable
47
+ device fingerprint that does not require any permission to read.
48
+ min_patterns: 2
49
+ patterns:
50
+ - sysctlbyname
51
+ - sysctl
52
+ - hw.machine
53
+ - hw.model
54
+ - MTLCreateSystemDefaultDevice
55
+ - recommendedMaxWorkingSetSize
56
+ - supportsFamily
57
+ - id: IOS_DISPLAY_FINGERPRINT
58
+ title: Display characteristics fingerprinting
59
+ summary: Reads Display Characteristics
60
+ category: privacy-fingerprint
61
+ severity: info
62
+ description: |
63
+ The binary reads fine-grained display characteristics (native pixel
64
+ bounds, native scale, refresh rate). These vary by exact device model and
65
+ contribute entropy to a device fingerprint.
66
+ min_patterns: 2
67
+ patterns:
68
+ - nativeBounds
69
+ - nativeScale
70
+ - maximumFramesPerSecond
71
+ - mainScreen
72
+ - id: IOS_NETWORK_INTERFACE_ENUM
73
+ title: Network interface enumeration
74
+ summary: Enumerates Network Interfaces
75
+ category: privacy-fingerprint
76
+ severity: info
77
+ description: |
78
+ The binary enumerates local network interfaces and addresses via
79
+ getifaddrs / if_nametoindex. This exposes local IP addresses and interface
80
+ topology that can be used to infer network environment and aid
81
+ fingerprinting.
82
+ patterns:
83
+ - getifaddrs
84
+ - if_nametoindex
85
+ - freeifaddrs
86
+ - id: IOS_FONT_ENUMERATION
87
+ title: Installed font enumeration
88
+ summary: Enumerates Installed Fonts
89
+ category: privacy-fingerprint
90
+ severity: info
91
+ description: |
92
+ The binary enumerates the installed font families. The set of installed
93
+ fonts is a classic fingerprinting vector that requires no permission.
94
+ min_patterns: 2
95
+ patterns:
96
+ - familyNames
97
+ - fontNamesForFamilyName
98
+ - UIFont
@@ -0,0 +1,133 @@
1
+ ---
2
+ text: Mobile (MASVS) capability and weakness review for iOS/macOS Mach-O binaries
3
+ group: SYMBOL_REVIEWS
4
+ exe_type: MachO
5
+ binary_type: MachO
6
+ rules:
7
+ - id: IOS_WEAK_CRYPTO
8
+ title: Weak or broken cryptography in use
9
+ summary: Uses Weak Cryptography
10
+ description: |
11
+ The binary references cryptographic primitives that are considered weak or
12
+ broken: MD5/SHA-1 digests, DES/3DES/RC4 ciphers, or ECB block mode. These
13
+ offer no meaningful protection for confidentiality or integrity and should
14
+ be replaced with SHA-256+/AES-GCM. Maps to OWASP MASVS-CRYPTO-1.
15
+ patterns:
16
+ - CC_MD5
17
+ - CC_MD4
18
+ - CC_MD2
19
+ - CC_SHA1
20
+ - kCCAlgorithmDES
21
+ - kCCAlgorithm3DES
22
+ - kCCAlgorithmRC4
23
+ - kCCOptionECBMode
24
+ - CCCryptorCreateWithMode
25
+ - id: IOS_CERT_PINNING
26
+ title: TLS certificate or public-key pinning present
27
+ summary: Pins TLS Certificates
28
+ description: |
29
+ The binary evaluates server trust directly or uses a pinning library
30
+ (TrustKit, AFNetworking's AFSecurityPolicy, Alamofire ServerTrust). Pinning
31
+ hardens TLS against compromised or rogue certificate authorities. Its
32
+ presence is a positive control; its absence in an app handling sensitive
33
+ data is worth reviewing. Maps to OWASP MASVS-NETWORK-2.
34
+ patterns:
35
+ - SecTrustEvaluate
36
+ - SecPolicyCreateSSL
37
+ - setSSLPinningMode
38
+ - AFSecurityPolicy
39
+ - TrustKit
40
+ - pinnedCertificates
41
+ - evaluateServerTrust
42
+ - ServerTrustPolicy
43
+ - certificatePinning
44
+ - id: IOS_WEBVIEW_JS_BRIDGE
45
+ title: Web view JavaScript bridge in use
46
+ summary: Bridges Native and JavaScript
47
+ description: |
48
+ The binary exposes a native<->JavaScript bridge through WKWebView
49
+ (addScriptMessageHandler / evaluateJavaScript) or the deprecated UIWebView
50
+ (stringByEvaluatingJavaScriptFromString). Bridges that pass untrusted web
51
+ content into native handlers can lead to data exposure or code execution
52
+ and warrant input-validation review. Maps to OWASP MASVS-PLATFORM-2.
53
+ patterns:
54
+ - addScriptMessageHandler
55
+ - stringByEvaluatingJavaScriptFromString
56
+ - evaluateJavaScript
57
+ - WKUserContentController
58
+ - JSContext
59
+ - javaScriptEnabled
60
+ - UIWebView
61
+ - id: IOS_INSECURE_STORAGE
62
+ title: Potentially insecure local data storage
63
+ summary: May Store Data Insecurely
64
+ description: |
65
+ The binary writes data via APIs that do not encrypt at rest by default,
66
+ such as NSUserDefaults, plain file writes (writeToFile / NSData writes) or
67
+ NSKeyedArchiver. Storing credentials, tokens or PII through these instead
68
+ of the Keychain leaves it readable on a compromised or backed-up device.
69
+ Maps to OWASP MASVS-STORAGE-1.
70
+ min_patterns: 2
71
+ patterns:
72
+ - NSUserDefaults
73
+ - standardUserDefaults
74
+ - "writeToFile:atomically:"
75
+ - "writeToURL:atomically:"
76
+ - NSKeyedArchiver
77
+ - dataWithContentsOfFile
78
+ - id: IOS_PASTEBOARD_WRITE
79
+ title: General pasteboard (clipboard) usage
80
+ summary: Writes to the System Pasteboard
81
+ description: |
82
+ The binary uses the general (system-wide) UIPasteboard, which is readable
83
+ by any other app on the device. Copying sensitive values such as passwords
84
+ or tokens to it can leak them to unrelated apps. Maps to OWASP
85
+ MASVS-STORAGE-2.
86
+ patterns:
87
+ - generalPasteboard
88
+ - UIPasteboardNameGeneral
89
+ - pasteboardWithName
90
+ ---
91
+ text: Mobile (MASVS) string and behaviour review for iOS/macOS Mach-O binaries
92
+ group: EXE_REVIEWS
93
+ exe_type: MachO
94
+ binary_type: MachO
95
+ rules:
96
+ - id: IOS_JAILBREAK_DETECTION
97
+ title: Jailbreak detection routines present
98
+ summary: Detects Jailbroken Devices
99
+ description: |
100
+ The binary references file system paths, URL schemes or libraries that are
101
+ characteristic of jailbroken devices (Cydia, MobileSubstrate, apt, an SSH
102
+ daemon, or shell binaries). This indicates a runtime integrity / anti-
103
+ tampering check. Its presence is a positive control; the checks themselves
104
+ are bypassable and should not be relied on alone. Maps to OWASP
105
+ MASVS-RESILIENCE-1.
106
+ include_informative_strings: true
107
+ patterns:
108
+ - /Applications/Cydia.app
109
+ - cydia://
110
+ - /Library/MobileSubstrate
111
+ - MobileSubstrate.dylib
112
+ - /bin/bash
113
+ - /bin/sh
114
+ - /usr/sbin/sshd
115
+ - /etc/apt
116
+ - /private/var/lib/apt
117
+ - /private/var/stash
118
+ - frida
119
+ - cynject
120
+ - id: IOS_INSECURE_TRANSPORT_ATS
121
+ title: App Transport Security weakened
122
+ summary: Weakens Secure Transport
123
+ description: |
124
+ The app's Info.plist weakens App Transport Security, either globally
125
+ (NSAllowsArbitraryLoads) or per host (NSExceptionAllowsInsecureHTTPLoads),
126
+ permitting cleartext HTTP or downgraded TLS connections. This exposes
127
+ traffic to interception and tampering. Maps to OWASP MASVS-NETWORK-1.
128
+ include_informative_strings: true
129
+ patterns:
130
+ - ATS_NSAllowsArbitraryLoads
131
+ - ATS_NSAllowsArbitraryLoadsForMedia
132
+ - ATS_NSAllowsArbitraryLoadsInWebContent
133
+ - ATS_NSExceptionAllowsInsecureHTTPLoads
@@ -0,0 +1,34 @@
1
+ ---
2
+ text: Sensitive data-access capability review for iOS/macOS Mach-O binaries
3
+ group: SYMBOL_REVIEWS
4
+ exe_type: MachO
5
+ binary_type: MachO
6
+ rules:
7
+ - id: IOS_CALENDAR_REMINDERS_ACCESS
8
+ title: Calendar / reminders access
9
+ summary: Can Access Calendar and Reminders
10
+ category: privacy-access
11
+ severity: info
12
+ description: |
13
+ The binary references EventKit (EKEventStore) used to read calendar events
14
+ and reminders. These reveal the user's schedule, locations and the people
15
+ they meet, and are permission-gated personal data.
16
+ patterns:
17
+ - EKEventStore
18
+ - requestFullAccessToEvents
19
+ - requestFullAccessToReminders
20
+ - predicateForEventsWithStartDate
21
+ - id: IOS_USER_TRACKING_REQUEST
22
+ title: App Tracking Transparency request
23
+ summary: Requests Tracking Authorization
24
+ category: privacy-tracking
25
+ severity: medium
26
+ description: |
27
+ The binary requests tracking authorization via ATTrackingManager. This
28
+ indicates the app intends to track the user across apps and websites,
29
+ typically to access the advertising identifier (IDFA) for cross-app
30
+ tracking, and requires an NSUserTrackingUsageDescription consent string.
31
+ patterns:
32
+ - ATTrackingManager
33
+ - requestTrackingAuthorization
34
+ - trackingAuthorizationStatus
@@ -0,0 +1,76 @@
1
+ ---
2
+ text: Privacy manifest and consent posture review for iOS/macOS app bundles
3
+ group: EXE_REVIEWS
4
+ exe_type: MachO
5
+ binary_type: MachO
6
+ rules:
7
+ - id: IOS_TRACKING_DECLARED
8
+ title: Cross-app tracking declared in privacy manifest
9
+ summary: Declares Cross-App Tracking
10
+ category: privacy-tracking
11
+ severity: medium
12
+ include_informative_strings: true
13
+ description: |
14
+ The app's privacy manifest sets NSPrivacyTracking to true and/or lists
15
+ NSPrivacyTrackingDomains, declaring that it (or an embedded SDK) tracks
16
+ users across apps and websites. Connections to the declared tracking
17
+ domains are blocked unless the user grants tracking permission.
18
+ patterns:
19
+ - PRIV_NSPrivacyTracking
20
+ - PRIV_NSPrivacyTrackingDomains
21
+ - id: IOS_PRIVACY_MANIFEST_MISSING
22
+ title: Privacy manifest absent
23
+ summary: Ships Without a Privacy Manifest
24
+ category: privacy-posture
25
+ severity: info
26
+ include_informative_strings: true
27
+ description: |
28
+ The app bundle ships without a PrivacyInfo.xcprivacy manifest. Since May
29
+ 2024 Apple requires apps (and many SDKs) to declare data collection,
30
+ tracking and required-reason API usage in a privacy manifest. Its absence
31
+ means the app's data practices are undeclared and may trigger App Store
32
+ review warnings.
33
+ patterns:
34
+ - PRIV_PrivacyManifestMissing
35
+ - id: IOS_UNDECLARED_REQUIRED_REASON_API
36
+ title: Required-reason API used without declaration
37
+ summary: Uses Undeclared Required-Reason APIs
38
+ category: privacy-posture
39
+ severity: medium
40
+ include_informative_strings: true
41
+ description: |
42
+ The binary references one of Apple's "required reason" APIs (user defaults,
43
+ file timestamps, system boot time, disk space, or active keyboards) for a
44
+ category that is not declared in the privacy manifest. Apple requires an
45
+ approved reason to be declared for each such category in use; undeclared
46
+ use corresponds to App Store warning ITMS-91053.
47
+ patterns:
48
+ - PRIV_UNDECLARED_NSPrivacyAccessedAPICategoryUserDefaults
49
+ - PRIV_UNDECLARED_NSPrivacyAccessedAPICategoryFileTimestamp
50
+ - PRIV_UNDECLARED_NSPrivacyAccessedAPICategorySystemBootTime
51
+ - PRIV_UNDECLARED_NSPrivacyAccessedAPICategoryDiskSpace
52
+ - PRIV_UNDECLARED_NSPrivacyAccessedAPICategoryActiveKeyboards
53
+ - id: IOS_SENSITIVE_PERMISSIONS_DECLARED
54
+ title: Sensitive data permissions declared
55
+ summary: Declares Sensitive Data Permissions
56
+ category: privacy-access
57
+ severity: info
58
+ include_informative_strings: true
59
+ description: |
60
+ The app's Info.plist declares consent strings for high-sensitivity data
61
+ sources (location, contacts, camera, microphone, photos, health, motion,
62
+ Bluetooth, local network or tracking). The presence of a consent string
63
+ means the app (or a bundled SDK) is provisioned to access that data, even
64
+ if the corresponding API calls are obfuscated or loaded dynamically.
65
+ patterns:
66
+ - PRIV_NSLocationWhenInUseUsageDescription
67
+ - PRIV_NSLocationAlwaysAndWhenInUseUsageDescription
68
+ - PRIV_NSContactsUsageDescription
69
+ - PRIV_NSCameraUsageDescription
70
+ - PRIV_NSMicrophoneUsageDescription
71
+ - PRIV_NSPhotoLibraryUsageDescription
72
+ - PRIV_NSHealthShareUsageDescription
73
+ - PRIV_NSMotionUsageDescription
74
+ - PRIV_NSBluetoothAlwaysUsageDescription
75
+ - PRIV_NSLocalNetworkUsageDescription
76
+ - PRIV_NSUserTrackingUsageDescription
@@ -0,0 +1,81 @@
1
+ ---
2
+ text: Privacy side-channel API review for iOS/macOS Mach-O binaries
3
+ group: SYMBOL_REVIEWS
4
+ exe_type: MachO
5
+ binary_type: MachO
6
+ rules:
7
+ - id: IOS_APP_PRESENCE_PROBE
8
+ title: Installed-app presence probing
9
+ summary: Probes for Installed Apps
10
+ category: privacy-sidechannel
11
+ severity: medium
12
+ description: |
13
+ The binary calls canOpenURL, which (combined with the schemes listed in
14
+ LSApplicationQueriesSchemes) lets it detect which other apps are installed
15
+ without any permission. Enumerating installed apps is a side channel for
16
+ profiling users (interests, finance, dating, messaging) and is restricted
17
+ by App Store policy when used for tracking.
18
+ patterns:
19
+ - canOpenURL
20
+ - id: IOS_LOCAL_NETWORK_SCAN
21
+ title: Local network / Bonjour scanning
22
+ summary: Scans the Local Network
23
+ category: privacy-sidechannel
24
+ severity: medium
25
+ description: |
26
+ The binary discovers services and devices on the local network using
27
+ NWBrowser or NSNetServiceBrowser (Bonjour). Local-network scanning reveals
28
+ nearby devices (speakers, TVs, IoT, computers) and is a strong signal of
29
+ the user's home/office environment. It requires the local-network
30
+ permission and should be justified.
31
+ patterns:
32
+ - NWBrowser
33
+ - NSNetServiceBrowser
34
+ - netServiceBrowser
35
+ - CFNetServiceBrowser
36
+ - id: IOS_KEYCHAIN_PERSISTENCE
37
+ title: Identifier persistence across reinstalls
38
+ summary: Persists Data Across Reinstalls
39
+ category: privacy-fingerprint
40
+ severity: medium
41
+ description: |
42
+ The binary stores Keychain items with an always-available accessibility
43
+ class (kSecAttrAccessibleAlways / AfterFirstUnlock). Because Keychain
44
+ items survive app deletion, this is frequently used to persist a device or
45
+ install identifier across uninstall/reinstall, defeating the privacy
46
+ expectation that removing an app clears its local state.
47
+ patterns:
48
+ - kSecAttrAccessibleAlways
49
+ - kSecAttrAccessibleAlwaysThisDeviceOnly
50
+ - kSecAttrAccessibleAfterFirstUnlock
51
+ ---
52
+ text: Privacy side-channel posture review for iOS/macOS app bundles
53
+ group: EXE_REVIEWS
54
+ exe_type: MachO
55
+ binary_type: MachO
56
+ rules:
57
+ - id: IOS_MANY_QUERY_SCHEMES
58
+ title: Large installed-app query list declared
59
+ summary: Declares Many App Query Schemes
60
+ category: privacy-sidechannel
61
+ severity: medium
62
+ include_informative_strings: true
63
+ description: |
64
+ The app declares a large LSApplicationQueriesSchemes list, enabling it to
65
+ probe for many specific apps via canOpenURL. A broad query list is a
66
+ strong indicator of installed-app enumeration for user profiling rather
67
+ than legitimate single-app interoperation.
68
+ patterns:
69
+ - PRIV_ManyApplicationQueriesSchemes
70
+ - id: IOS_LOCAL_NETWORK_DECLARED
71
+ title: Local-network service discovery declared
72
+ summary: Declares Bonjour Service Discovery
73
+ category: privacy-sidechannel
74
+ severity: info
75
+ include_informative_strings: true
76
+ description: |
77
+ The app's Info.plist declares NSBonjourServices, indicating it browses for
78
+ services on the local network. Combined with local-network access this
79
+ exposes the user's nearby devices and environment.
80
+ patterns:
81
+ - PRIV_NSBonjourServices
@@ -446,25 +446,25 @@ def print_reviews_table(reviews, files):
446
446
  files: A list of file names associated with the reviews.
447
447
 
448
448
  """
449
+ # Surface the rule category column only when at least one review carries one
450
+ # (e.g. the privacy/fingerprinting rules), so existing reports are unchanged.
451
+ has_category = any(r.get("category") for r in reviews)
449
452
  table = create_findings_table(files, "BLint Capability Review")
453
+ if has_category:
454
+ table.add_column("Category")
450
455
  table.add_column("Capabilities")
451
456
  table.add_column("Evidence (Top 5)", overflow="fold")
452
457
  for r in reviews:
453
458
  evidences = [e.get("function") for e in r.get("evidence")]
454
459
  evidences = list(islice(evidences, EVIDENCE_LIMIT))
460
+ row = [r.get("id")]
455
461
  if len(files) > 1:
456
- table.add_row(
457
- r.get("id"),
458
- os.path.basename(r.get("exe_name")),
459
- r.get("summary"),
460
- "\n".join(evidences),
461
- )
462
- else:
463
- table.add_row(
464
- r.get("id"),
465
- r.get("summary"),
466
- "\n".join(evidences),
467
- )
462
+ row.append(os.path.basename(r.get("exe_name")))
463
+ if has_category:
464
+ row.append(r.get("category") or "")
465
+ row.append(r.get("summary"))
466
+ row.append("\n".join(evidences))
467
+ table.add_row(*row)
468
468
  console.print(table)
469
469
 
470
470
 
@@ -1878,13 +1878,23 @@ def parse(exe_file, disassemble=False): # pylint: disable=too-many-locals,too-m
1878
1878
  metadata = add_mach0_metadata(exe_file, metadata, parsed_obj)
1879
1879
  if objc_metadata := parse_objc_metadata(parsed_obj):
1880
1880
  metadata["objc_metadata"] = objc_metadata
1881
+ metadata = merge_macho_objc_functions(metadata)
1881
1882
  metadata = standardize_keys(metadata)
1882
1883
  if informative_strings := parse_informative_strings(parsed_obj):
1883
1884
  metadata["informative_strings"] = informative_strings
1884
1885
  metadata["import_dependencies"] = analyze_import_deps(metadata)
1885
1886
  metadata["llvm_target_tuple"] = construct_llvm_target_tuple(metadata)
1886
1887
  metadata = add_derived_attributes(metadata, parsed_obj)
1887
- if disassemble and isinstance(
1888
+ if disassemble and metadata.get("is_encrypted"):
1889
+ # FairPlay-encrypted App Store binaries have an encrypted __TEXT
1890
+ # segment; disassembling it would yield meaningless instructions.
1891
+ # Report the reason clearly instead of producing noise.
1892
+ metadata["disassembly_skipped"] = "fairplay_encrypted"
1893
+ LOG.warning(
1894
+ f"Skipping disassembly of FairPlay-encrypted binary {exe_file}; "
1895
+ "decrypt on-device (e.g. with a dump tool) before analysis."
1896
+ )
1897
+ elif disassemble and isinstance(
1888
1898
  parsed_obj, (lief.ELF.Binary, lief.PE.Binary, lief.MachO.Binary)
1889
1899
  ):
1890
1900
  metadata["disassembled_functions"] = disassemble_functions(parsed_obj, metadata)
@@ -3062,6 +3072,115 @@ def add_mach0_header_data(exe_file, metadata, parsed_obj):
3062
3072
  return metadata
3063
3073
 
3064
3074
 
3075
+ def _parse_address(value) -> int | None:
3076
+ """Parse an address that may be an int or a hex/decimal string."""
3077
+ if isinstance(value, int):
3078
+ return value
3079
+ if isinstance(value, str) and value.strip():
3080
+ with contextlib.suppress(ValueError):
3081
+ return int(value.strip(), 0)
3082
+ return None
3083
+
3084
+
3085
+ def merge_macho_function_starts(functions, symtab_symbols, parsed_obj):
3086
+ """Augment the function list with ``LC_FUNCTION_STARTS`` entry points.
3087
+
3088
+ iOS/macOS release binaries are typically stripped, leaving lief's aggregated
3089
+ ``functions`` list with little more than ``__mh_execute_header``. The
3090
+ ``LC_FUNCTION_STARTS`` load command records the entry address of every
3091
+ function regardless of symbol stripping. We merge those addresses in,
3092
+ reusing any name already known for the address (from a surviving symbol) and
3093
+ synthesising a ``sub_<address>`` name otherwise, so the disassembler can
3094
+ recover and link the full set of functions.
3095
+ """
3096
+ functions = list(functions or [])
3097
+ known_addresses = set()
3098
+ for fn in functions:
3099
+ addr = _parse_address(fn.get("address"))
3100
+ if addr is not None:
3101
+ known_addresses.add(addr)
3102
+
3103
+ # Address -> best available symbol name, used to label recovered entries.
3104
+ address_names = {}
3105
+ for symbol in symtab_symbols or []:
3106
+ addr = _parse_address(symbol.get("address"))
3107
+ name = symbol.get("short_name") or symbol.get("name")
3108
+ if addr and name and addr not in address_names:
3109
+ address_names[addr] = name
3110
+
3111
+ start_addresses = []
3112
+ with contextlib.suppress(AttributeError, TypeError):
3113
+ fs = parsed_obj.function_starts
3114
+ if fs is not None and not isinstance(fs, lief.lief_errors):
3115
+ for entry in fs.functions:
3116
+ addr = entry.address if hasattr(entry, "address") else entry
3117
+ if isinstance(addr, int):
3118
+ start_addresses.append(addr)
3119
+
3120
+ next_index = len(functions)
3121
+ for addr in sorted(set(start_addresses)):
3122
+ if addr in known_addresses:
3123
+ continue
3124
+ known_addresses.add(addr)
3125
+ functions.append(
3126
+ {
3127
+ "index": next_index,
3128
+ "name": address_names.get(addr, f"sub_{addr:x}"),
3129
+ "address": ADDRESS_FMT.format(addr).strip(),
3130
+ "size": 0,
3131
+ "flags": None,
3132
+ }
3133
+ )
3134
+ next_index += 1
3135
+ return functions
3136
+
3137
+
3138
+ def merge_macho_objc_functions(metadata):
3139
+ """Seed/label functions from recovered Objective-C method implementations.
3140
+
3141
+ Each recovered implementation address is added as a function (when not
3142
+ already present) and, when an entry was only synthesised as ``sub_<addr>``
3143
+ from ``LC_FUNCTION_STARTS``, its name is upgraded to the readable
3144
+ ``-[Class selector]`` form.
3145
+ """
3146
+ objc_metadata = metadata.get("objc_metadata")
3147
+ if not objc_metadata:
3148
+ return metadata
3149
+ method_imps = objc_metadata.get("method_imps")
3150
+ if not method_imps:
3151
+ return metadata
3152
+
3153
+ functions = list(metadata.get("functions") or [])
3154
+ by_address = {}
3155
+ for fn in functions:
3156
+ addr = _parse_address(fn.get("address"))
3157
+ if addr is not None:
3158
+ by_address[addr] = fn
3159
+
3160
+ next_index = len(functions)
3161
+ for imp in method_imps:
3162
+ addr = imp.get("address")
3163
+ name = imp.get("name")
3164
+ if not isinstance(addr, int) or not name:
3165
+ continue
3166
+ existing = by_address.get(addr)
3167
+ if existing is None:
3168
+ entry = {
3169
+ "index": next_index,
3170
+ "name": name,
3171
+ "address": ADDRESS_FMT.format(addr).strip(),
3172
+ "size": 0,
3173
+ "flags": None,
3174
+ }
3175
+ functions.append(entry)
3176
+ by_address[addr] = entry
3177
+ next_index += 1
3178
+ elif str(existing.get("name", "")).startswith("sub_"):
3179
+ existing["name"] = name
3180
+ metadata["functions"] = functions
3181
+ return metadata
3182
+
3183
+
3065
3184
  def add_mach0_functions(metadata, parsed_obj):
3066
3185
  """Extracts MachO functions and symbols from the parsed object and adds them to the metadata.
3067
3186
 
@@ -3088,6 +3207,15 @@ def add_mach0_functions(metadata, parsed_obj):
3088
3207
  )
3089
3208
  ]
3090
3209
 
3210
+ # Stripped release builds (the common case for shipped iOS/macOS apps)
3211
+ # expose almost no local symbols, so lief's aggregated ``functions`` may
3212
+ # contain only ``__mh_execute_header``. Recover the real entry points from
3213
+ # the ``LC_FUNCTION_STARTS`` table so disassembly and callgraph
3214
+ # construction have a complete set of functions to work with.
3215
+ metadata["functions"] = merge_macho_function_starts(
3216
+ metadata["functions"], metadata["symtab_symbols"], parsed_obj
3217
+ )
3218
+
3091
3219
  if exe_type:
3092
3220
  metadata["exe_type"] = exe_type
3093
3221
  if parsed_obj.dylinker: