-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fixes OWASP/mastg#2589 [MASWE-0025] Weak Signature #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sydseter
wants to merge
19
commits into
OWASP:main
Choose a base branch
from
sydseter:MASWE-0025
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0f37ebf
Fixes https://github.com/OWASP/mastg/issues/2589a
sydseter bc64a2d
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 33cf9e9
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter d2be5f9
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 7339b85
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter f0fa3b1
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 3a6e45a
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 7b0ebf6
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter a57e459
Refine impact descriptions for signature forgery
sydseter 4349c2b
Merge branch 'main' into MASWE-0025
sydseter 121acb3
Fix capitalization and punctuation in MASWE-0025
sydseter 203f042
Update MASWE-0025.md
sydseter 7362d02
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 0b73916
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter 0911e1e
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter d6e2f07
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter b22eda7
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter f6adc03
Update weaknesses/MASVS-CRYPTO/MASWE-0025.md
sydseter c7bec86
Add CWE-1240 to MASWE-0025 mapping
sydseter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,41 @@ | ||
| --- | ||
| title: Improper Generation of Cryptographic Signatures | ||
| title: Improper Generation of Digital Signatures | ||
| id: MASWE-0025 | ||
| alias: improper-signature-generation | ||
| platform: [android, ios] | ||
| profiles: [L1, L2] | ||
| mappings: | ||
| masvs-v1: [MSTG-CRYPTO-4] | ||
| masvs-v2: [MASVS-CRYPTO-1] | ||
| cwe: [327] | ||
| cwe: [327, 1240] | ||
|
|
||
| refs: | ||
| - https://developer.android.com/privacy-and-security/cryptography#deprecated-functionality | ||
| - https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf | ||
| - https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf | ||
| - https://csrc.nist.gov/pubs/ir/8547/ipd | ||
| draft: | ||
| description: The use of algorithms with insufficient strength for signatures such as SHA1withRSA, etc. in a security-sensitive context should be avoided to ensure the integrity and authenticity of the data. | ||
| topics: null | ||
| status: placeholder | ||
| status: new | ||
|
|
||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| Using deprecated, risky, or broken hash or signature algorithms, such as MD5withRSA or SHA1withRSA, can allow attackers to forge digital signatures. In mobile apps this can enable tampering with locally verified data such as configuration files, licenses, feature flags, offline content, or cached responses while still passing signature checks, breaking authenticity, integrity, and accountability. | ||
|
|
||
| ## Impact | ||
|
|
||
| - **Loss of authenticity**: Signature forgery may allow an attacker to sign data on behalf of another entity, so the app can no longer trust where the data originated. | ||
| - **Loss of integrity**: Signature forgery may allow an attacker to alter data while keeping the signature check passing, compromising its integrity. | ||
| - **Loss of accountability**: Signature forgery enables plausible deniability and weakens non repudiation when signatures are used as proof of approval or origin. | ||
|
|
||
| ## Modes of Introduction | ||
sydseter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - **Using deprecated, risky, or broken algorithms**: For example, choosing RSA SHA1 or RSA MD5 algorithms, even when documentation marks them as deprecated. | ||
| - **Using insufficient key sizes**: For example, generating RSA keys of 1024 bits or using non standard elliptic curves below current security levels. | ||
| - **Using insufficiently collision-resistant hash functions**: Selecting MD5 or SHA1, which have known collision attacks, can allow attackers to craft different messages with the same digest. | ||
|
|
||
| ## Mitigations | ||
|
|
||
| - **Choose a modern, collision-resistant algorithm with sufficient bit-lengths**: Choose a signature algorithm with at least 128 bits of security. Suitable choices include RSA with 3072 bit keys, ECDSA with NIST P256 or P384, and EdDSA with Ed25519 or Edwards448. | ||
| - **Design signatures with algorithm agility**: Adopt crypto agility-aware design as described in ["NIST.CSWP.39.2pd: Considerations for Achieving Crypto Agility"](https://nvlpubs.nist.gov/nistpubs/CSWP/NIST.CSWP.39.2pd.pdf?). For example, include metadata or version fields that allow migration to stronger algorithms as recommended in documents like [NIST SP 800-131A: Transitioning the Use of Cryptographic Algorithms and Key Lengths](https://csrc.nist.gov/pubs/sp/800/131/a/r2/final) and post quantum transition guidance (["NIST IR 8547: Transition to Post-Quantum Cryptography Standards"](https://csrc.nist.gov/pubs/ir/8547/ipd)). | ||
| - **Do not rely on defaults**: Enforce minimum algorithm and key requirements **explicitly** in the code. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.