mirror of
https://github.com/github/codeql.git
synced 2026-04-18 21:44:02 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
20
javascript/ql/src/StandardLibrary/ParseIntRadix.ql
Normal file
20
javascript/ql/src/StandardLibrary/ParseIntRadix.ql
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @name Call to parseInt without radix
|
||||
* @description Calls to the 'parseInt' function should always specify a radix to avoid accidentally
|
||||
* parsing a number as octal.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @id js/parseint-without-radix
|
||||
* @tags reliability
|
||||
* maintainability
|
||||
* external/cwe/cwe-676
|
||||
* @precision very-high
|
||||
* @deprecated This is no longer a problem with modern browsers. Deprecated since 1.17.
|
||||
*/
|
||||
|
||||
import javascript
|
||||
|
||||
from DataFlow::CallNode parseInt
|
||||
where parseInt = DataFlow::globalVarRef("parseInt").getACall() and
|
||||
parseInt.getNumArgument() = 1
|
||||
select parseInt, "Missing radix parameter."
|
||||
Reference in New Issue
Block a user