Skip to content

Commit 29df697

Browse files
committed
Swift: Docs review response: consistent naming
1 parent ba7d375 commit 29df697

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.qhelp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<qhelp>
33
<overview>
44

5-
<p>Sensitive information that is stored unencrypted in the defaults database is accessible to an attacker who gains access to that database. For example, the information could be accessed by any process or user in a rooted device, or exposed through another vulnerability.</p>
5+
<p>Sensitive information that is stored unencrypted in an application preference store, such as the user defaults database or the iCloud-backed ubiquitous key-value store, is accessible to an attacker who gains access to that data store. For example, the information could be accessed by any process or user in a rooted device, by compromised app extensions, or could be exposed through another vulnerability.</p>
66

77
</overview>
88
<recommendation>
@@ -12,7 +12,7 @@
1212
</recommendation>
1313
<example>
1414

15-
<p>The following example shows three cases of storing information using NSUserDefaults. In the 'BAD' case, the data that is stored is sensitive (a credit card number) and is not encrypted. In the 'GOOD' cases, the data is either not sensitive, or is protected with encryption.</p>
15+
<p>The following example shows three cases of storing information using UserDefaults. In the 'BAD' case, the data that is stored is sensitive (a credit card number) and is not encrypted. In the 'GOOD' cases, the data is either not sensitive, or is protected with encryption.</p>
1616

1717
<sample src="CleartextStoragePreferences.swift" />
1818

@@ -21,7 +21,10 @@
2121

2222
<li>
2323
OWASP Top 10:2021:
24-
<a href="https://owasp.org/Top10/A02_2021-Cryptographic_Failures/">A02:2021 � Cryptographic Failures</a>.
24+
<a href="https://owasp.org/Top10/A02_2021-Cryptographic_Failures/">A02:2021 &mdash; Cryptographic Failures</a>.
25+
</li>
26+
<li>
27+
Apple Developer Documentation: <a href="https://developer.apple.com/documentation/foundation/userdefaults">UserDefaults</a>, <a href="https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore">NSUbiquitousKeyValueStore</a>
2528
</li>
2629

2730
</references>

swift/ql/src/queries/Security/CWE-312/CleartextStoragePreferences.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Cleartext storage of sensitive information in application preferences
3-
* @description Storing sensitive information in a non-encrypted database can expose it to an attacker.
2+
* @name Cleartext storage of sensitive information in an application preference store
3+
* @description Storing sensitive information in a non-encrypted store can expose it to an attacker.
44
* @kind path-problem
55
* @problem.severity warning
66
* @security-severity 7.5
@@ -17,13 +17,13 @@ import codeql.swift.dataflow.TaintTracking
1717
import DataFlow::PathGraph
1818

1919
/**
20-
* A `DataFlow::Node` of something that gets stored in a preferences store.
20+
* A `DataFlow::Node` of something that gets stored in an application preference store.
2121
*/
2222
abstract class Stored extends DataFlow::Node {
2323
abstract string getStoreName();
2424
}
2525

26-
/** The `DataFlow::Node` of an expression that gets written to the defaults database */
26+
/** The `DataFlow::Node` of an expression that gets written to the user defaults database */
2727
class UserDefaultsStore extends Stored {
2828
UserDefaultsStore() {
2929
exists(ClassDecl c, AbstractFunctionDecl f, CallExpr call |
@@ -38,7 +38,7 @@ class UserDefaultsStore extends Stored {
3838
override string getStoreName() { result = "the user defaults database" }
3939
}
4040

41-
/** The `DataFlow::Node` of an expression that gets written to iCloud */
41+
/** The `DataFlow::Node` of an expression that gets written to the iCloud-backed NSUbiquitousKeyValueStore */
4242
class NSUbiquitousKeyValueStore extends Stored {
4343
NSUbiquitousKeyValueStore() {
4444
exists(ClassDecl c, AbstractFunctionDecl f, CallExpr call |

0 commit comments

Comments
 (0)