feat(sast): Android and iOS app analysis with mobsfscan
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m13s

mobsfscan (LGPL-3.0, used unchanged) checks Java, Kotlin, Swift and
Objective-C code and the AndroidManifest and Info.plist settings, with a
CWE and the OWASP MASVS requirement on each rule. It runs on the image's
semgrep (installed --no-deps, its other dependencies pinned) with metrics
off.

Three of its defaults would mislead on a customer's tree, so:
- docker/pruefwerk_mobsfscan.py clears its path ignores: libsast skips
  any path that merely contains 'spec' or 'fixtures', so code under
  inspection/ vanished. Ours are anchored as /name/ and passed with -c,
  which also stops it reading a .mobsf file from the repository.
- --type auto configures the iOS rules only when there is no Android
  code, so a React Native or Flutter app was checked as Android only. It
  now runs once per platform present.
- Manifest and plist matches report line 1; the line that sets the key is
  looked up. App-wide "missing protection" hints carry no location and
  are left out.

The scan runs in scan_tree after cppcheck when the tree holds Java,
Kotlin, Swift or Objective-C (`.m`/`.mm` now count as objc); a failure
records a sast_mobile skip, which the CRA view treats like a failed
semgrep. The control map binds mobsfscan by CWE to cra-ai-1, 7, 8, 9, 13,
14, 15, 16 and 20, each with only the languages it has rules for.

Nightly: android-insecure and ios-insecure fixtures, and one flaw each in
the React Native fixture's Java and Swift, so both platforms must run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-01 18:37:15 +02:00
1 parent 3ad6cc538b
commit 043f3589bd
29 files changed
+961 -15

No files matched your search

+150
View File
@@ -21,6 +21,22 @@
"cra-ai-1-tls-verify-disabled",
"cra-ai-1-cors-wildcard"
]
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin"
],
"cwe": [
"CWE-489",
"CWE-1104",
"CWE-276",
"CWE-1021",
"CWE-284"
],
"rules": []
}
],
"note": null,
@@ -97,6 +113,23 @@
"cra-ai-7-weak-password-hash"
],
"check": "Passwords must be stored with a slow, salted password hash (bcrypt, scrypt, Argon2id, PBKDF2); a fast or unsalted hash (MD5, SHA-1, SHA-256) of a password violates it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift",
"objc"
],
"cwe": [
"CWE-287",
"CWE-305",
"CWE-303"
],
"rules": [],
"check": "Passwords must be stored with a slow, salted password hash (bcrypt, scrypt, Argon2id, PBKDF2); a fast or unsalted hash (MD5, SHA-1, SHA-256) of a password violates it."
}
],
"note": null,
@@ -131,6 +164,19 @@
"cra-ai-8-c-hardcoded-credential"
],
"check": "No credential (password, key, token) may be written into the product's source, as a variable or a #define: every device would ship the same secret. A placeholder or an empty value does not violate it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin"
],
"cwe": [
"CWE-798"
],
"rules": [],
"check": "No credential (password, key, token) may be written into the product's source or configuration: every installation would ship the same secret."
}
],
"note": null,
@@ -147,6 +193,19 @@
"cwe": [],
"rules": [],
"check": "Credentials must not be kept in plain text in the source or configuration; a real secret committed to the repository violates it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"swift",
"objc"
],
"cwe": [
"CWE-312"
],
"rules": [],
"check": "Credentials must not be kept in plain text in the source or configuration; a real secret committed to the repository violates it."
}
],
"note": null,
@@ -250,6 +309,26 @@
"cra-ai-13-c-broken-hash-or-cipher"
],
"check": "Data must not be protected with a broken algorithm: MD5, SHA-1 or DES used for integrity or confidentiality violates it. A non-security use (a cache key, a checksum of public data) does not."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift",
"objc"
],
"cwe": [
"CWE-327",
"CWE-326",
"CWE-780",
"CWE-649",
"CWE-329",
"CWE-1204"
],
"rules": [],
"check": "Data must not be protected with a broken algorithm: MD5, SHA-1 or DES used for integrity or confidentiality violates it. A non-security use (a cache key, a checksum of public data) does not."
}
],
"note": null,
@@ -273,6 +352,24 @@
"cra-ai-14-node-weak-cipher"
],
"check": "Stored data must be encrypted with a current cipher and mode (AES-GCM, ChaCha20-Poly1305); DES, RC4, ECB mode or a hard-coded key violates it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift",
"objc"
],
"cwe": [
"CWE-921",
"CWE-311",
"CWE-312",
"CWE-532"
],
"rules": [],
"check": "Stored data must be encrypted with a current cipher and mode (AES-GCM, ChaCha20-Poly1305); DES, RC4, ECB mode or a hard-coded key violates it."
}
],
"note": null,
@@ -296,6 +393,23 @@
"cra-ai-15-node-cleartext-http"
],
"check": "Network traffic must use TLS 1.2 or newer with certificate checking; plain HTTP for sensitive data, disabled verification or old protocol versions violate it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift",
"objc"
],
"cwe": [
"CWE-295",
"CWE-319",
"CWE-757"
],
"rules": [],
"check": "Network traffic must use TLS 1.2 or newer with certificate checking; plain HTTP for sensitive data, disabled verification or old protocol versions violate it."
}
],
"note": null,
@@ -328,6 +442,21 @@
"cra-ai-16-c-predictable-random"
],
"check": "Keys, nonces, tokens and session ids must come from a cryptographically secure random source (the MCU's hardware RNG, a DRBG); rand() used for them violates it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift"
],
"cwe": [
"CWE-330",
"CWE-321"
],
"rules": [],
"check": "Keys must not be committed to the source: a private key or secret key in the repository violates it."
}
],
"note": null,
@@ -415,6 +544,27 @@
],
"rules": [],
"check": "The code must be free of memory-safety defects: out-of-bounds access, use of uninitialised memory, leaks, null dereferences and similar defects violate it."
},
{
"tool": "mobsfscan",
"scan_type": "sast",
"languages": [
"java",
"kotlin",
"swift",
"objc"
],
"cwe": [
"CWE-78",
"CWE-611",
"CWE-502",
"CWE-749",
"CWE-95",
"CWE-73",
"CWE-676"
],
"rules": [],
"check": "Untrusted input must not reach a shell, an SQL statement or an HTML response unencoded, and the code must not write past a buffer or let input control a format string: a command or query built from a variable, request input echoed into a response, strcpy, strcat, sprintf, gets, scanf(\"%s\") or a non-literal format argument violates it."
}
],
"note": null,