forked from OWASP/owasp-mastg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port MASTG-TEST-0081 (by @Guardsquare) (OWASP#3034)
* Port MASTG-TEST-0081 * fix test ID * add overview and re-use prev. overview for the recommendation * fix md lint --------- Co-authored-by: Carlos Holguera <[email protected]>
- Loading branch information
1 parent
7d2c88f
commit 24809dc
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Obtaining the Code Signature Format Version | ||
platform: ios | ||
--- | ||
|
||
To extract the code signature format version from a signed binary, you can use @MASTG-TOOL-0114. | ||
|
||
The version is obtained by calling `codesign -dv` and identifying the value of `v` in the `CodeDirectory` row: | ||
|
||
```bash | ||
$ codesign -dv MASTestApp.app | ||
Executable=/Users/user/MASTestApp.app | ||
Identifier=org.owasp.mastestapp.MASTestApp-iOS | ||
Format=Mach-O universal (armv7 arm64) | ||
CodeDirectory v=20400 size=404674 flags=0x0(none) hashes=12635+7 location=embedded | ||
Signature size=4858 | ||
... | ||
``` | ||
|
||
In this case the version is 20400, since the output contains `v=20400`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
platform: ios | ||
title: Usage of Outdated Code Signature Format | ||
id: MASTG-TEST-0220 | ||
type: [static] | ||
weakness: MASWE-0104 | ||
--- | ||
|
||
## Overview | ||
|
||
On iOS, code signatures verify the integrity and authenticity of an app's binary, preventing unauthorized modifications and ensuring that the app is trusted by the operating system. Apple regularly updates its [code signature formats](https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format) to enhance cryptographic strength and improve protection against tampering. | ||
|
||
Using an outdated code signature format may expose the app to security risks, as older formats may lack support for current cryptographic standards and may be more vulnerable to manipulation. Adopting the latest code signature format helps maintain app integrity and ensures compatibility with the latest security features in iOS. | ||
|
||
## Steps | ||
|
||
1. Extract the package as described in @MASTG-TECH-0058. | ||
2. Obtain the version of the code signature format as described in @MASTG-TECH-0112. | ||
|
||
## Observation | ||
|
||
The output should contain the version of the code signature format. | ||
|
||
## Evaluation | ||
|
||
The test fails if the version is below the [recommended one](https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format "Apple Developer"). | ||
|
||
Ensure that the app is using the [latest code signing format](https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format "Apple Developer"). You can retrieve the signing certificate format with @MASTG-TECH-0112. This will ensure that the integrity of the app is protected according to the latest cryptographic standards, preventing tampering with the app binary and ensuring that the unmodified copy is distributed to users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters