Files
codeql/change-notes/1.18/analysis-javascript.md
2018-09-05 21:22:29 +01:00

11 KiB

Improvements to JavaScript analysis

General improvements

New queries

Query Tags Purpose
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. 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. Results shown on LGTM by default.

Changes to existing queries

Query Expected impact Change
Arguments redefined Fewer results This rule previously also flagged redefinitions of eval. This was an oversight that is now fixed.
Comparison between inconvertible types Fewer results This rule now flags fewer comparisons involving parameters.
Comparison between inconvertible types Lower severity The severity of this rule has been revised to "warning".
CORS misconfiguration for credentials transfer More true-positive results This rule now treats header names case-insensitively.
Hard-coded credentials More true-positive results This rule now recognizes secret cryptographic keys.
Incomplete string escaping or encoding Better name, more true-positive results This rule has been renamed to more clearly reflect its purpose. Also, it now recognizes incomplete URL encoding and decoding.
Insecure randomness More true-positive results This rule now recognizes secret cryptographic keys.
Misleading indentation after control statement Fewer results This rule temporarily ignores TypeScript files.
Missing rate limiting More true-positive results, fewer false-positive results This rule now recognizes additional rate limiters and expensive route handlers.
Missing X-Frame-Options HTTP header Fewer false-positive results This rule now treats header names case-insensitively.
Omitted array element Fewer results This rule temporarily ignores TypeScript files.
Reflected cross-site scripting Fewer false-positive results This rule now treats header names case-insensitively.
Semicolon insertion Fewer results This rule temporarily ignores TypeScript files.
Server-side URL redirect More true-positive results This rule now treats header names case-insensitively.
Superfluous trailing arguments Fewer false-positive results This rule now ignores calls to some empty functions.
Type confusion through parameter tampering Fewer false-positive results This rule no longer flags emptiness checks.
Uncontrolled command line More true-positive results This rule now recognizes indirect command injection through sh -c and similar.
Unused variable Fewer results This rule no longer flags class expressions that could be made anonymous. While technically true, these results are not interesting.
Unused variable Renamed This rule has been renamed to "Unused variable, import, function or class" to reflect the fact that it flags different kinds of unused program elements.
Use of incompletely initialized object Fewer results This rule now flags the constructor instead its errorneous this or super expressions.
Useless conditional Fewer results This rule no longer flags uses of boolean return values.
Useless conditional Fewer results This rule now flags fewer comparisons involving parameters.

Changes to QL libraries

  • HTTP and HTTPS requests made using the Node.js http.request and https.request APIs and the Electron Electron.net.request and Electron.ClientRequest APIs are modeled as RemoteFlowSources.
  • HTTP header names are now always normalized to lower case to reflect the fact that they are case insensitive. In particular, the result of HeaderDefinition.getAHeaderName, and the first parameter of HeaderDefinition.defines, ExplicitHeaderDefinition.definesExplicitly and RouteHandler.getAResponseHeader is now always a lower-case string.
  • New AST nodes have been added for TypeScript 2.9 and 3.0 features.
  • The class JsonParseCall has been deprecated. Use JsonParserCall instead.
  • The handling of spread arguments in the data flow library has been changed: DataFlow::InvokeNode.getArgument(i) is now only defined when there is no spread argument at or before argument position i, and similarly InvokeNode.getNumArgument is only defined for invocations without spread arguments.