Scanner: semgrep Severity: medium Rule: cra-ai-14-swift-secret-in-appstorage CWE: CWE-312 CRA: cra-ai-14 — Speicher-Schutz (Data at Rest) (Annex I)
Description
A password, token or key is kept in @AppStorage, which stores it in UserDefaults, an unencrypted plist in the app container that backups and device extraction read (CWE-312). Store it in the Keychain instead.
## medium Finding
**Scanner:** semgrep
**Severity:** medium
**Rule:** cra-ai-14-swift-secret-in-appstorage
**CWE:** CWE-312
**CRA:** cra-ai-14 — Speicher-Schutz (Data at Rest) (Annex I)
### Description
A password, token or key is kept in @AppStorage, which stores it in UserDefaults, an unencrypted plist in the app container that backups and device extraction read (CWE-312). Store it in the Keychain instead.
### Location
**File:** `compliance-agent/rules/cra_semgrep_swift.swift` (line 25)
### Code
```
@AppStorage("refreshToken") var refreshToken: String = ""
```
### Remediation
Exclude rule fixture/example paths from secret-storage scans or move examples out of production paths.
---
*Fingerprint:* `1ef7fc62cefdac321d23ddabfb6f4e4328532b2f715683ff03905ff76a8cac09`
*Generated by compliance-scanner*
[Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
medium Finding
Scanner: semgrep
Severity: medium
Rule: cra-ai-14-swift-secret-in-appstorage
CWE: CWE-312
CRA: cra-ai-14 — Speicher-Schutz (Data at Rest) (Annex I)
Description
A password, token or key is kept in @AppStorage, which stores it in UserDefaults, an unencrypted plist in the app container that backups and device extraction read (CWE-312). Store it in the Keychain instead.
Location
File:
compliance-agent/rules/cra_semgrep_swift.swift(line 25)Code
Remediation
Exclude rule fixture/example paths from secret-storage scans or move examples out of production paths.
Fingerprint:
1ef7fc62cefdac321d23ddabfb6f4e4328532b2f715683ff03905ff76a8cac09Generated by compliance-scanner
Open in Prüfwerk / In Prüfwerk öffnen
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.