diff --git a/change-notes/1.18/analysis-javascript.md b/change-notes/1.18/analysis-javascript.md index d20be9de3d8..5635130bd6e 100644 --- a/change-notes/1.18/analysis-javascript.md +++ b/change-notes/1.18/analysis-javascript.md @@ -28,7 +28,7 @@ | **Query** | **Tags** | **Purpose** | |-----------------------------|-----------|--------------------------------------------------------------------| -| Clear text logging of sensitive information (`js/cleartext-logging`) | security, external/cwe/cwe-312, external/cwe/cwe-315, external/cwe/cwe-359 | Highlights logging of sensitive information, indicating a violation of [CWE-312](https://cwe.mitre.org/data/definitions/312.html). Results shown on lgtm by default. | +| Clear-text logging of sensitive information (`js/clear-text-logging`) | security, external/cwe/cwe-312, external/cwe/cwe-315, external/cwe/cwe-359 | Highlights logging of sensitive information, indicating a violation of [CWE-312](https://cwe.mitre.org/data/definitions/312.html). Results shown on LGTM by default. | | Disabling Electron webSecurity (`js/disabling-electron-websecurity`) | security, frameworks/electron | Highlights Electron browser objects that are created with the `webSecurity` property set to false. Results shown on LGTM by default. | | Enabling Electron allowRunningInsecureContent (`js/enabling-electron-insecure-content`) | security, frameworks/electron | Highlights Electron browser objects that are created with the `allowRunningInsecureContent` property set to true. Results shown on LGTM by default. | | Use of externally-controlled format string (`js/tainted-format-string`) | security, external/cwe/cwe-134 | Highlights format strings containing user-provided data, indicating a violation of [CWE-134](https://cwe.mitre.org/data/definitions/134.html). Results shown on LGTM by default. | diff --git a/javascript/ql/src/Security/CWE-312/CleartextLogging.ql b/javascript/ql/src/Security/CWE-312/CleartextLogging.ql index 6e866f7d567..eb009200804 100644 --- a/javascript/ql/src/Security/CWE-312/CleartextLogging.ql +++ b/javascript/ql/src/Security/CWE-312/CleartextLogging.ql @@ -1,11 +1,11 @@ /** - * @name Clear text logging of sensitive information - * @description Sensitive information logged without encryption or hashing can expose it to an - * attacker. + * @name Clear-text logging of sensitive information + * @description Logging sensitive information without encryption or hashing can + * expose it to an attacker. * @kind problem * @problem.severity error * @precision high - * @id js/cleartext-logging + * @id js/clear-text-logging * @tags security * external/cwe/cwe-312 * external/cwe/cwe-315 diff --git a/javascript/ql/src/Security/CWE-312/CleartextStorage.qhelp b/javascript/ql/src/Security/CWE-312/CleartextStorage.qhelp index d70e4fedae4..025afa4b0e9 100644 --- a/javascript/ql/src/Security/CWE-312/CleartextStorage.qhelp +++ b/javascript/ql/src/Security/CWE-312/CleartextStorage.qhelp @@ -15,7 +15,7 @@ which are stored on the machine of the end-user.
Ensure that sensitive information is always encrypted before being stored. If possible, avoid placing sensitive information in cookies altogether. -Instead, prefer storing, in the cookie, a key that can be used to lookup the +Instead, prefer storing, in the cookie, a key that can be used to look up the sensitive information.
diff --git a/javascript/ql/src/semmle/javascript/frameworks/Logging.qll b/javascript/ql/src/semmle/javascript/frameworks/Logging.qll index 301e8742c51..1a1c702a7bc 100644 --- a/javascript/ql/src/semmle/javascript/frameworks/Logging.qll +++ b/javascript/ql/src/semmle/javascript/frameworks/Logging.qll @@ -16,8 +16,10 @@ abstract class LoggerCall extends DataFlow::CallNode { } +/** + * Gets a log level name that is used in RFC5424, `npm`, `console`. + */ private string getAStandardLoggerMethodName() { - // log level names used in RFC5424, `npm`, `console` result = "crit" or result = "debug" or result = "error" or @@ -32,7 +34,7 @@ private string getAStandardLoggerMethodName() { } /** - * Provides classes for working the builtin NodeJS/Browser `console`. + * Provides classes for working the builtin Node.js/Browser `console`. */ private module Console { diff --git a/javascript/ql/src/semmle/javascript/security/SensitiveActions.qll b/javascript/ql/src/semmle/javascript/security/SensitiveActions.qll index f4929a0a163..b3df3b6c2b3 100644 --- a/javascript/ql/src/semmle/javascript/security/SensitiveActions.qll +++ b/javascript/ql/src/semmle/javascript/security/SensitiveActions.qll @@ -22,6 +22,7 @@ module HeuristicNames { string suspiciousNonPassword() { result = "(?is).*(secret|account|accnt|(?