Skip to content

Commit 21ed5c4

Browse files
committed
Merge branch 'main' into rdmarsh2/improve-exec-tainted
Manual fix for conflict in Models.qll
2 parents d6fd83d + 3123abf commit 21ed5c4

File tree

190 files changed

+44645
-1984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+44645
-1984
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The 'Uncontrolled data in SQL query' (cpp/sql-injection) query now supports the `libpqxx` library.

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

0 commit comments

Comments
 (0)