Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
27a83e6
C++: add RelationalOpcode and RelationalInstruction
Sep 13, 2018
4e1a37c
C++: add isStrict to RelationalInstruction
Sep 14, 2018
d7e630b
C++: Add IR-based port of Guards library
Sep 14, 2018
ad8f30d
C++: accept test output and add IR guards tests
Sep 14, 2018
0273b20
C++: make internal classes private
Sep 14, 2018
b5cd48d
C++: comments on new classes and predicates
Sep 14, 2018
d6cea1b
C++: Add class and predicates to other IR stages
Sep 14, 2018
e40ce91
C++: document new IR class and predicates
Sep 14, 2018
755e21d
C++: improve conversion handling in IRGuards.qll
Sep 18, 2018
4c94144
C++: remove abstract classes in IR
Sep 18, 2018
cc97cf9
C++: add isReachableFromFunctionEntry
Sep 18, 2018
9011e13
C++: handle conversions in IR to AST translation
Sep 20, 2018
e2d24a2
C++: fix comment
Sep 20, 2018
42fc28b
JS: add ad hoc whitelist checks as sanitizers
Sep 24, 2018
ce11b53
JS: recognize Express headers as RequestInputAccess
asger-semmle Sep 21, 2018
e78a4e9
JS: update output from other Express tests
asger-semmle Sep 21, 2018
52061b3
JS: address review comments: improve regex, limit sanitizer usage
Sep 26, 2018
097a281
JS: change notes for AdHocWhitelistCheckSanitizer
Sep 26, 2018
a47b1dc
JS: recognize Express header access with dynamic name
asger-semmle Sep 26, 2018
057c3a9
JS: update other Express test outputs
asger-semmle Sep 26, 2018
e2ccd57
.gitignore everything under .vs in repo root dir
jbj Sep 26, 2018
a93939b
Merge pull request #230 from esben-semmle/js/ad-hoc-whitelisting
semmle-qlci Sep 26, 2018
26c1397
CPP/CSharp/Javascript: Clean up QLDoc and bring the different XML.qll…
aschackmull Sep 26, 2018
9198f5b
CPP/CSharp/Java/Javascript: Use concat in XMLParent.allCharactersStri…
aschackmull Sep 26, 2018
c5d08ff
Don't .gitignore .vs/VSWorkspaceSettings.json
jbj Sep 26, 2018
c36e7f0
Merge pull request #231 from asger-semmle/express-headers
semmle-qlci Sep 26, 2018
df4bd36
Merge pull request #236 from aschackmull/xml-qll/use-concat
semmle-qlci Sep 27, 2018
b3dbb44
Java: Improve performance of TypeFlow.
aschackmull Sep 27, 2018
87271fb
Merge pull request #234 from jbj/gitignore-vs
adityasharad Sep 27, 2018
f323fa1
C++: test changes from previous commit
Sep 27, 2018
b6cc6a3
C++: Fix BinaryLogicalOperators always being guards
Sep 27, 2018
93732d8
C++: Combine IR guard tests into one ql file
Sep 27, 2018
f5bd737
Version: Fix C# and JavaScript Eclipse plugins for 1.18.
adityasharad Sep 28, 2018
b8b41a4
Merge pull request #248 from adityasharad/fix/eclipse-versions-1.18
Sep 28, 2018
1c71a85
Version: Bump to 1.18.1 dev.
adityasharad Sep 28, 2018
16004fa
Merge pull request #197 from rdmarsh2/rdmarsh/cpp/ir-guards
jbj Sep 28, 2018
89183bd
Merge pull request #244 from aschackmull/java/typeflow-perf
semmle-qlci Sep 29, 2018
eb987d5
C++: Make `Instruction.toString()` less expensive
dave-bartolomeo Sep 30, 2018
3709195
C++: Fix test expectations after rebase
dave-bartolomeo Sep 30, 2018
9ffdf3b
Merge pull request #254 from dave-bartolomeo/dave/InstructionToString
jbj Oct 1, 2018
8cc7f5c
JavaScript: Update model of `DOMException`.
Oct 1, 2018
828d3cb
Merge pull request #250 from adityasharad/version/1.18.1-dev
nickrolfe Oct 1, 2018
0882eb7
Merge rc/1.18 into master.
adityasharad Oct 1, 2018
7518267
Merge pull request #257 from xiemaisi/js/fix-DOMException-model
Oct 1, 2018
13ef492
Merge pull request #258 from adityasharad/merge/1.18-master-011018
aibaars Oct 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
# qltest projects and artifacts
*/ql/test/**/*.testproj
*/ql/test/**/*.actual
/.vs/slnx.sqlite
/.vs/ql/v15/Browse.VC.opendb
/.vs/ql/v15/Browse.VC.db
/.vs/ProjectSettings.json

# Visual studio temporaries, except a file used by QL4VS
.vs/*
!.vs/VSWorkspaceSettings.json
2 changes: 2 additions & 0 deletions change-notes/1.19/analysis-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Modelling of taint flow through array operations has been improved. This may give additional results for the security queries.

* The taint tracking library now recognizes additional sanitization patterns. This may give fewer false-positive results for the security queries.

* Support for popular libraries has been improved. Consequently, queries may produce more results on code bases that use the following features:
- file system access, for example through [fs-extra](https://github.com/jprichardson/node-fs-extra) or [globby](https://www.npmjs.com/package/globby)

Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Documentation/CommentedOutCode.qll
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class CommentBlock extends Comment {
*/
predicate hasLocationInfo(string filepath, int startline, int startcolumn, int endline, int endcolumn) {
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, _, _) and
this.lastComment().getLocation().hasLocationInfo(filepath, _, _, endline, endcolumn)
this.lastComment().getLocation().hasLocationInfo(_, _, _, endline, endcolumn)
}
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/ql/src/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Semmle C/C++ Default Queries
Bundle-SymbolicName: com.semmle.plugin.semmlecode.cpp.queries;singleton:=true
Bundle-Version: 1.18.0.qualifier
Bundle-Version: 1.18.1.qualifier
Bundle-Vendor: Semmle Ltd.
Bundle-ActivationPolicy: lazy
Require-Bundle: com.semmle.plugin.qdt.ui;bundle-version="[1.18.0.qualifier,1.18.0.qualifier]"
Require-Bundle: com.semmle.plugin.qdt.ui;bundle-version="[1.18.1.qualifier,1.18.1.qualifier]"
33 changes: 13 additions & 20 deletions cpp/ql/src/semmle/code/cpp/Element.qll
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,38 @@ import semmle.code.cpp.Location
private import semmle.code.cpp.Enclosing
private import semmle.code.cpp.internal.ResolveClass

/**
* Get the `@element` that represents this `@element`.
* Normally this will simply be `e`, but sometimes it is not.
* For example, for an incomplete struct `e` the result may be a
* complete struct with the same name.
*/
private cached @element resolveElement(@element e) {
if isClass(e)
then result = resolveClass(e)
else result = e
}

/**
* Get the `Element` that represents this `@element`.
* Normally this will simply be a cast of `e`, but sometimes it is not.
* For example, for an incomplete struct `e` the result may be a
* complete struct with the same name.
*/
pragma[inline]
Element mkElement(@element e) {
result = resolveElement(e)
unresolveElement(result) = e
}

/**
* Get an `@element` that resolves to the `Element`. This should
* INTERNAL: Do not use.
*
* Gets an `@element` that resolves to the `Element`. This should
* normally only be called from member predicates, where `e` is not
* `this` and you need the result for an argument to a database
* extensional.
* See `underlyingElement` for when `e` is `this`.
*/
pragma[inline]
@element unresolveElement(Element e) {
resolveElement(result) = e
not result instanceof @usertype and
result = e
or
e = resolveClass(result)
}

/**
* Get the `@element` that this `Element` extends. This should normally
* INTERNAL: Do not use.
*
* Gets the `@element` that this `Element` extends. This should normally
* only be called from member predicates, where `e` is `this` and you
* need the result for an argument to a database extensional.
* See `unresolveElement` for when `e` is not `this`.
Expand All @@ -53,10 +50,6 @@ Element mkElement(@element e) {
* `getLocation`, or `hasLocationInfo`.
*/
class ElementBase extends @element {
ElementBase() {
this = resolveElement(_)
}

/** Gets a textual representation of this element. */
string toString() { none() }
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/ql/src/semmle/code/cpp/Specifier.qll
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ class AttributeArgument extends Element, @attribute_arg {
}

override string toString() {
if exists (@attribute_arg_empty self | mkElement(self) = this)
if exists (@attribute_arg_empty self | self = underlyingElement(this))
then result = "empty argument"
else exists (string prefix, string tail
| (if exists(getName())
then prefix = getName() + "="
else prefix = "") and
(if exists (@attribute_arg_type self | mkElement(self) = this)
(if exists (@attribute_arg_type self | self = underlyingElement(this))
then tail = getValueType().getName()
else tail = getValueText()) and
result = prefix + tail)
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/semmle/code/cpp/Type.qll
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ private import semmle.code.cpp.internal.ResolveClass
* A C/C++ type.
*/
class Type extends Locatable, @type {
Type() { isType(underlyingElement(this)) }

/**
* Gets the name of this type.
*/
Expand Down
Loading