Skip to content

fix: [pull] main from github:main #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 552 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
552 commits
Select commit Hold shift + click to select a range
bb447d7
C++: Make sure missingGuardAgainstOverflow (and underflow) holds when…
MathiasVP Apr 14, 2021
53a320a
C++: Fix duplicate names.
MathiasVP Apr 14, 2021
b4f01c9
Merge pull request #5578 from MathiasVP/ast-flow-smart-pointers
jbj Apr 14, 2021
ed64ed3
C++: Make exprMightOverflowPositively/exprMightOverFlowNegatively hol…
MathiasVP Apr 14, 2021
64fed4c
Merge pull request #5677 from MathiasVP/fix-duplicate-ids-in-experime…
geoffw0 Apr 14, 2021
b29f35f
Fix formatting
dbartol Apr 14, 2021
392adf2
Workflows: Remove dry-run flag for labeller
aeisenberg Apr 14, 2021
a7fcf52
Python: Fix bad join in `total_cost`
tausbn Apr 14, 2021
56ba0f0
Merge pull request #5659 from github/aeisenberg/mark-as-stale
aeisenberg Apr 14, 2021
97186b3
Added comments for tests
artem-smotrakov Apr 14, 2021
897d124
Python: Prevent bad join in `isinstanceEvaluatesTo`
tausbn Apr 14, 2021
fe57876
Merge pull request #5643 from dbartol/smart-pointers/side-effect-refa…
rdmarsh2 Apr 14, 2021
b30ae39
Update InsufficientControlFlowManagementAfterRefactoringTheCode.ql
ihsinme Apr 14, 2021
4be183c
Merge pull request #5675 from erik-krogh/libXss
codeql-ci Apr 14, 2021
b3bdf89
rm VerificationMethodFlowConfig, use springframework-5.2.3 stub
haby0 Apr 15, 2021
bd3b317
Fix documentation of Modifier.qll
smowton Apr 15, 2021
b4a2a9d
JS: Fix extraction of non-substitution template literal types
asgerf Apr 15, 2021
972cc47
Merge pull request #5673 from hvitved/csharp/customizations
hvitved Apr 15, 2021
cb736c8
JS: Change note
asgerf Apr 15, 2021
f8570bb
JS: Update TRAP
asgerf Apr 15, 2021
0f24db8
C#: Improve performance of `SsaImpl::CallGraph::SimpleDelegateAnalysis`
hvitved Apr 12, 2021
5d05e4d
Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLi…
haby0 Apr 15, 2021
583d088
delete tomcat-embed-core stub, update the ServletGetMethod class
haby0 Apr 15, 2021
216f204
delete FilterClass
haby0 Apr 15, 2021
d269a7e
CWE-598 reduction
haby0 Apr 15, 2021
fa36ba9
Merge pull request #5471 from artem-smotrakov/el-injection
smowton Apr 15, 2021
0e183ab
Finish comment
haby0 Apr 15, 2021
7fbc623
C++: Accept test changes after making the exprMightOverFlow predicate…
MathiasVP Apr 15, 2021
578ce1e
Merge pull request #5683 from asgerf/js/typescript-template-literal-t…
codeql-ci Apr 15, 2021
b359205
Python: Add taint tests for .get() in flask
RasmusWL Apr 15, 2021
dedf765
Update java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjectionLi…
haby0 Apr 15, 2021
254de76
Remove unnecessary stubs
smowton Apr 15, 2021
c379940
Revert changes to unrelated query
smowton Apr 15, 2021
3e7dc12
Python: Port taint tests to use inline expectations
RasmusWL Apr 15, 2021
5d827b6
Actions: Change staleness calculation
aeisenberg Apr 15, 2021
c9c8259
Python: Disallow `PostUpdateNode` as `LocalSourceNode`
tausbn Apr 15, 2021
451d36d
Python: Allow _some_ `PostUpdateNode`s
tausbn Apr 15, 2021
b0975bb
Update supported C#/.NET versions
tamasvajk Apr 16, 2021
946fcf1
C#: Speedup `DispatchMethodOrAccessorCall::getAViableOverrider()`
hvitved Apr 14, 2021
605f28f
Merge pull request #5686 from smowton/haby0/JsonHijacking
aschackmull Apr 16, 2021
af0c32c
Python: Apply suggestions from code review
tausbn Apr 16, 2021
5c79ad2
Python: Apply suggestions from code review
tausbn Apr 16, 2021
e1028a2
Merge pull request #5667 from MathiasVP/use-range-analysis-in-overflow
geoffw0 Apr 16, 2021
92b4eb7
Python: Cleanup and more explanation
tausbn Apr 16, 2021
6ed1016
Merge pull request #5669 from tausbn/python-use-api-graphs-for-invoke
RasmusWL Apr 16, 2021
3c8ea16
Merge pull request #5668 from tausbn/python-use-api-graphs-in-fabric
RasmusWL Apr 16, 2021
40b7416
C#: Improve performance of `DisposeNotCalledOnException.ql`
hvitved Apr 16, 2021
f8d45f0
Revert "Revert "C++: Work around extractor issue CPP-383""
jbj Apr 16, 2021
5c2bf68
Merge pull request #5692 from tamasvajk/feature/doc-cs9
shati-patel Apr 16, 2021
50abb6e
C++: Cleanup test.c
MathiasVP Apr 16, 2021
1e32728
C++: Add false negative test.
MathiasVP Apr 16, 2021
64f8316
C++: Tidy up the ql file and accept test changes.
MathiasVP Apr 16, 2021
95742ae
C++: Accept test changes for the other experimental query in the dire…
MathiasVP Apr 16, 2021
f3661c3
Python: Clean up Django models using API graphs
tausbn Apr 16, 2021
e36b42a
Java: Fix invalid id in experimental query
MathiasVP Apr 17, 2021
c2d97b9
Merge branch 'main' into ihsinme-patch-259
ihsinme Apr 18, 2021
118840d
Merge pull request #5690 from tausbn/python-disallow-post-update-node…
yoff Apr 19, 2021
1ab75eb
Merge pull request #5708 from github/fix-id-in-JsonpInjection-1
jbj Apr 19, 2021
daad62c
Java: Add TaintedPath test.
aschackmull Apr 16, 2021
0651415
Java: Add XXE tests.
aschackmull Apr 19, 2021
c5193cf
Apply suggestions from code review
aschackmull Apr 19, 2021
29aec0d
Java: Adjust expected output.
aschackmull Apr 19, 2021
9e6f28e
fix bad join order in Xss.qll
erik-krogh Apr 19, 2021
9acc71a
Python: Get rid of all `_attr` methods in `Django.qll`
tausbn Apr 19, 2021
36abf87
Merge pull request #5714 from aschackmull/java/add-misc-qltests
smowton Apr 19, 2021
a27dac0
Java: Use shared flow summary library for csv models.
aschackmull Mar 19, 2021
60965b0
Java: Adjust some csv models.
aschackmull Mar 19, 2021
175c712
Java: Adjust some test output with more edges/nodes.
aschackmull Apr 13, 2021
579c955
Java: Adjust some tests.
aschackmull Apr 14, 2021
3986274
Java: Convert support for fluent interfaces.
aschackmull Apr 15, 2021
7d84cfa
Java: Add MapKeyContent and MapValueContent.
aschackmull Apr 15, 2021
b2cb284
Python: Add more examples of what is ok with new taint tests
RasmusWL Apr 19, 2021
9585390
Python: Taint tests, report error location first
RasmusWL Apr 19, 2021
d607c13
Python: Taint tests: include elment for forgotten MISSING
RasmusWL Apr 19, 2021
15e4b7f
C#: Remove CP from `HardcodedCredentials::getCredentialSink`
hvitved Apr 19, 2021
437bba1
Merge pull request #5716 from erik-krogh/vscodeRegress
codeql-ci Apr 19, 2021
80eb0a2
Apply suggestions from code review
aschackmull Apr 19, 2021
9128ec7
C#: A few minor SSA performance tweaks
hvitved Apr 19, 2021
33db0c1
Merge pull request #5689 from github/aeisenberg/rework-staleness
aschackmull Apr 19, 2021
5458c02
Merge pull request #5456 from aschackmull/java/adopt-flow-summary
aschackmull Apr 19, 2021
bc6685a
Python: Fix typo
tausbn Apr 19, 2021
cb524b6
Merge pull request #5611 from github/yo-h/java16
yo-h Apr 19, 2021
87cd724
Java: add extractor `diagnostic` queries
yo-h Apr 19, 2021
408954e
C#: Add Dapper to supported frameworks
tamasvajk Apr 20, 2021
61d4d17
C++: Simplify smart pointer model and accept test changes.
MathiasVP Apr 20, 2021
2b7e599
Merge pull request #5703 from MathiasVP/improve-access-of-memory-loca…
geoffw0 Apr 20, 2021
b2a7a3e
Merge pull request #5674 from hvitved/csharp/ssa/call-graph-perf
hvitved Apr 20, 2021
1f92390
Merge pull request #5695 from hvitved/csharp/dispose-not-called-on-ex…
hvitved Apr 20, 2021
dd1bb18
C#: Various data-flow performance tweaks
hvitved Apr 20, 2021
d4fdd50
Merge pull request #5723 from MathiasVP/cleanup-smart-ptr-model
jbj Apr 20, 2021
0ec3ee2
Style last use of `SecureASTCustomizer`
smowton Apr 20, 2021
581f4ed
JS: Generalize handling of route handler wrapper functions
asgerf Apr 20, 2021
1797b6c
C++: Add FP test from the work on smart pointers in dataflow.
MathiasVP Apr 20, 2021
93e55e2
C++: Fix FP in cpp/return-stack-allocated-memory.
MathiasVP Apr 20, 2021
f8d428c
JS: Use function-forwarding steps when tracking rate limiters
asgerf Apr 20, 2021
76700d1
Merge pull request #5684 from RasmusWL/flask-more-taint-tests
tausbn Apr 20, 2021
7046f1a
add taint-step for markdown-it when the HTML flag is set
erik-krogh Apr 15, 2021
13d9159
add change note
erik-krogh Apr 15, 2021
19c5889
use `mayHaveBooleanValue`
erik-krogh Apr 15, 2021
897105d
Merge pull request #5717 from tausbn/python-use-api-graphs-in-django
RasmusWL Apr 20, 2021
9bfb0d9
Autoformat QL
smowton Apr 20, 2021
31bd701
Python: Final `LocalSourceNode` fixes
tausbn Apr 20, 2021
a55b43b
Python: Use `LocalSourceNode` throughout `step`
tausbn Apr 20, 2021
f02c86c
Merge pull request #5726 from MathiasVP/fix-false-positive-in-return-…
jbj Apr 20, 2021
038bf61
Python: Add change note
tausbn Apr 20, 2021
38548c9
Python: Simplify charpred for `LocalSourceNode`
tausbn Apr 20, 2021
62dfd1f
improve the `markdown-it` model
erik-krogh Apr 20, 2021
a5cfdd2
Merge pull request #5467 from p0wn4j/groovy-execute
smowton Apr 20, 2021
43ca8ea
JS: Fix perf issue in forwardsParameter
asgerf Apr 20, 2021
583513b
Fix review findings
tamasvajk Apr 20, 2021
7581cba
Python: Fix forgotten type tracker
tausbn Apr 20, 2021
9c893cb
Merge branch 'main' of github.com:github/codeql into python-port-inse…
yoff Apr 20, 2021
2a07441
Python: `ModuleVariableNode`s are not API uses
tausbn Apr 20, 2021
c0569da
Python: Move `track`/`backtrack` to `LocalSourceNode`
tausbn Apr 20, 2021
890f96d
Python: Prevent bad joins in `TypeBackTracker`
tausbn Apr 20, 2021
f2de440
[Java] CWE-094: Query to detect Groovy Code Injections
Mar 21, 2021
bb58a50
Update GroovyInjection.qhelp
p0wn4j Apr 20, 2021
fc2c623
Python: Fix bad join
yoff Apr 20, 2021
98a0959
Docs: New "directional binding" pragmas
shati-patel Apr 20, 2021
00137f2
Merge pull request #5721 from github/yo-h/java-diagnostic-queries
yo-h Apr 20, 2021
357e1c0
Update javascript/ql/src/semmle/javascript/frameworks/Markdown.qll
erik-krogh Apr 20, 2021
3eba5b0
Merge pull request #5676 from hvitved/csharp/dispatch/get-a-viable-ov…
hvitved Apr 20, 2021
6408ee2
Python: Fix bad join
yoff Apr 20, 2021
01a9531
C++: Add `Instruction::getAParameterSideEffect()`.
dbartol Apr 20, 2021
5085e46
C++: Allow alias propagation to/from side effects (part 1)
dbartol Apr 20, 2021
ef0ea24
Merge pull request #5679 from tausbn/python-fix-bad-points-to-joins
yoff Apr 20, 2021
45968ef
C++: Add shared test headers to emulate standard library types
dbartol Apr 20, 2021
078d252
C++: Add missing `shared_ptr<T>` members
dbartol Apr 20, 2021
63fe4fb
C++: More general model for pointer flow
dbartol Apr 20, 2021
a447b04
C++: Impoved alias analysis of smart pointers
dbartol Apr 20, 2021
b9da6ce
C++: Prepare for merge of smart pointer models
dbartol Apr 21, 2021
1d0cb04
Merge from `main`
dbartol Apr 21, 2021
1ed11b2
Merge pull request #5725 from hvitved/csharp/dataflow/performance
hvitved Apr 21, 2021
def62e8
Merge pull request #5718 from hvitved/csharp/hardcoded-cred-remove-cp
hvitved Apr 21, 2021
7080b25
Merge pull request #5715 from hvitved/csharp/ssa/perf-tweaks
hvitved Apr 21, 2021
63a2657
Merge branch 'main' into inline-taint-tests
RasmusWL Apr 21, 2021
9362ae0
Merge pull request #5422 from tamasvajk/feature/sink-migration-ldap
aschackmull Apr 21, 2021
2a6f979
C# Add line of code metric query
tamasvajk Apr 21, 2021
2054693
Merge pull request #5738 from tamasvajk/feature/loc
tamasvajk Apr 21, 2021
a19373a
Merge pull request #5727 from tausbn/python-use-localsource-in-stepsu…
yoff Apr 21, 2021
2302c8d
Python: Model new `alias` method on django QuerySets
RasmusWL Apr 9, 2021
59c6f76
Python: Add test for new response.headers in Django
RasmusWL Apr 21, 2021
be9cbd7
Python: Add change-note for Django 3.2 support
RasmusWL Apr 21, 2021
f9599da
Java/C#: Move a couple of flow summary tweaks to the shared implement…
aschackmull Apr 21, 2021
e25305e
Java: Introduce LoC summary metric query
tamasvajk Apr 21, 2021
2c9a6e7
JS: Cache function-wrapping steps in type-tracking stage
asgerf Apr 21, 2021
30d7f0d
Merge pull request #5687 from RasmusWL/inline-taint-tests
codeql-ci Apr 21, 2021
9c72e73
Make ExecTainted easier to extend
owen-mc Apr 21, 2021
ba33508
Merge pull request #5601 from ihsinme/ihsinme-patch-259
geoffw0 Apr 21, 2021
a0f5e45
C#: Fix special case of default argument value extraction
tamasvajk Apr 21, 2021
94f0a15
Merge pull request #5682 from smowton/smowton/docs/fix-has-modifier-c…
smowton Apr 21, 2021
5a9e27c
Merge branch 'main' into django-3.2
RasmusWL Apr 21, 2021
0bc4b04
C++: Remove unnecessary cast
dbartol Apr 21, 2021
c113cfd
JS: Autoformat
asgerf Apr 21, 2021
bb7934b
JS: Change note
asgerf Apr 21, 2021
e98bfe9
JS: QLDoc
asgerf Apr 21, 2021
3832100
C++: Isolate models from AST dataflow's reference/object conflation
dbartol Apr 21, 2021
fe8deea
JS: Autoformat
asgerf Apr 21, 2021
cac1bef
C++: deprecate cpp/return-stack-allocated-object
rdmarsh2 Apr 21, 2021
a7cc9f9
Merge pull request #5745 from tamasvajk/feature/fix-arg-default
tamasvajk Apr 22, 2021
9c93686
Exclude code from XML files
tamasvajk Apr 22, 2021
5149ffd
C#: Add extraction error diagnostic query
tamasvajk Apr 21, 2021
353d43a
Log model errors even in standalone extraction
tamasvajk Apr 21, 2021
b05e211
Fix failing test
tamasvajk Apr 21, 2021
ff9327a
Add diagnostic query to get correctly extracted files
tamasvajk Apr 21, 2021
64354bb
Fix test results after rebase
tamasvajk Apr 22, 2021
1a708af
Include compilation errors in diagnostic check
tamasvajk Apr 22, 2021
1dab159
C#: Adjust 'fromSource' to hold only on files passed to the compiler …
tamasvajk Apr 22, 2021
9f17045
Include constructors in abstract class
owen-mc Apr 21, 2021
e448dcb
Avoid bad join order
owen-mc Apr 21, 2021
4b8d4f5
Update docs
owen-mc Apr 21, 2021
8a01799
Make imports private
owen-mc Apr 22, 2021
a8a920c
Add change note
tamasvajk Apr 22, 2021
fea9f5f
Merge pull request #5746 from owen-mc/java/refactor-exec-tainted
owen-mc Apr 22, 2021
180904e
Revert "Java: Convert Google HTTP client API parseAs sink to CSV for…
tamasvajk Apr 22, 2021
9b1c54e
Add argument indices to HTTP header splitting sinks
tamasvajk Apr 22, 2021
6c78a24
Revert erroneous refactoring in header splitting sink base class
tamasvajk Apr 22, 2021
1caa5c4
Adjust hostname verifier sink identifier name
tamasvajk Apr 22, 2021
2b8afe5
Merge pull request #5747 from rdmarsh2/rdmarsh2/cpp/deprecate-return-…
MathiasVP Apr 22, 2021
7134eb9
Improve documentation of csv sink models
tamasvajk Apr 22, 2021
cb28bc8
Merge branch 'main' into feature/java-sinks-csv
tamasvajk Apr 22, 2021
b36d35b
Revert "C#: Adjust 'fromSource' to hold only on files passed to the c…
tamasvajk Apr 22, 2021
ed42c87
Adjust 'fromSource' to hold only on '.cs' files
tamasvajk Apr 22, 2021
bdb4142
Merge pull request #5748 from asgerf/js/rate-limiting-fixes
codeql-ci Apr 22, 2021
3e4ff9e
Merge pull request #5742 from RasmusWL/django-3.2
tausbn Apr 22, 2021
5d0a4ca
C++: Add `{AllAliased}` side effects for smart pointers
dbartol Apr 22, 2021
3b04bed
Stub out additional bits of Alias model for C#
dbartol Apr 22, 2021
635fb4c
Merge pull request #5685 from erik-krogh/markdownIt
codeql-ci Apr 22, 2021
96a4d91
Merge pull request #5731 from shati-patel/docs/unbind-pragmas
shati-patel Apr 23, 2021
6e059ea
C++: Remove reference to obsolete issue CPP-383
jbj Apr 23, 2021
6de5b30
C++: Replace Jira ticket reference with GH issue
jbj Apr 23, 2021
4c597dd
C#: Improve performance of guards library
hvitved Apr 22, 2021
956507b
C#: Add guards stress test
hvitved Apr 22, 2021
e607712
C++: Only unary and binary arithmetic operations and left shifts are now
MathiasVP Apr 23, 2021
43dc9bb
Merge pull request #5744 from tamasvajk/feature/java-loc
tamasvajk Apr 23, 2021
e3f10c0
Cleanup DiagnosticError classes
tamasvajk Apr 23, 2021
b4bd7af
Add change note
tamasvajk Apr 23, 2021
819be43
Fix alphabetical order of supported frameworks
tamasvajk Apr 23, 2021
1b4c3c7
Fix code review findings
tamasvajk Apr 23, 2021
bc8c558
Merge pull request #5743 from aschackmull/java/flow-summary-tweaks
aschackmull Apr 23, 2021
9b5bb95
Merge pull request #5696 from jbj/reapply-inconsistency-workaround
jbj Apr 23, 2021
6f2103f
Merge pull request #5722 from github/tamasvajk-patch-1
shati-patel Apr 23, 2021
3cf4f1f
C++: Accept test changes.
MathiasVP Apr 23, 2021
86822f6
C++: Exclude pointer results from cpp/integer-overflow-tainted.
MathiasVP Apr 23, 2021
004450b
C#: Add missing `StringBuilder` flow summaries
hvitved Apr 23, 2021
455b840
Fix all dead qhelp links
smowton Apr 23, 2021
c3058f4
Merge pull request #5749 from tamasvajk/feature/fix-fromsource
tamasvajk Apr 23, 2021
a7030c7
Merge pull request #5308 from tamasvajk/feature/flow-sources-sinks
tamasvajk Apr 23, 2021
78b9682
Fix dead links in JS externs too
smowton Apr 23, 2021
772d5ea
C++: Add change note.
MathiasVP Apr 26, 2021
824c243
C#: Add change note
hvitved Apr 26, 2021
d717fc7
Use Microsoft archive of vijaysk's blog
smowton Apr 26, 2021
a09c12a
Merge pull request #5537 from alexet/ambig-super
shati-patel Apr 26, 2021
3889c8a
Python: Use only `TApiNode` in `API::Impl`
tausbn Apr 26, 2021
3670c72
Actions: Use the main branch of the codeql action
aeisenberg Apr 26, 2021
0e7eeb3
Merge pull request #5678 from MathiasVP/sound-expr-might-overflow-pre…
geoffw0 Apr 26, 2021
0e53ad3
Actions: Add permissions block to code scanning workflow
aeisenberg Apr 26, 2021
0b322a3
update JS/TS versions to reflect supported versions
erik-krogh Apr 27, 2021
37db21d
Merge pull request #5284 from yoff/python-port-insecure-protocol
RasmusWL Apr 27, 2021
05d693e
C++: Also include the assignment versions in exprThatCanOverflow.
MathiasVP Apr 27, 2021
a41e905
C++: Delete the fix that was introduced in bb447d7174141dc518e6ce9036…
MathiasVP Apr 27, 2021
04a785b
C++: Accept test changes.
MathiasVP Apr 27, 2021
79ed94b
Merge pull request #5779 from erik-krogh/updateJSAndTSVersionDoc
codeql-ci Apr 27, 2021
017beb6
Java: Use separate data-flow copy for `PredictableSeedFlowConfiguration`
hvitved Apr 27, 2021
e08b629
Add documentation for URL opening sinks
tamasvajk Apr 27, 2021
fb60611
Merge pull request #5754 from hvitved/csharp/guards/performance
hvitved Apr 27, 2021
2e266c7
Merge pull request #5756 from hvitved/csharp/string-builder-fluent
hvitved Apr 27, 2021
64a2320
Merge pull request #5757 from smowton/smowton/admin/fix-dead-qhelp-links
smowton Apr 27, 2021
afa8925
Merge pull request #5780 from MathiasVP/cleanup-missingGuard-predicat…
geoffw0 Apr 27, 2021
0509a12
Merge pull request #5770 from tausbn/python-small-api-graph-fix
yoff Apr 27, 2021
5b79094
Fix naming in HTTPS URL check
tamasvajk Apr 27, 2021
51e08d4
Fix error severity
tamasvajk Apr 27, 2021
9178f4b
add support for the anser library
erik-krogh Apr 27, 2021
4cc8866
Merge pull request #5557 from tamasvajk/feature/java-sinks-csv
tamasvajk Apr 27, 2021
c6db90e
Merge pull request #5775 from aeisenberg/aeisenberg/codeql-action-main
aeisenberg Apr 27, 2021
3737764
Merge pull request #5781 from hvitved/java/predictable-seed-df6
hvitved Apr 27, 2021
0f141ed
Merge pull request #5737 from dbartol/dbartol/smart-pointers/work
MathiasVP Apr 27, 2021
c27363c
Fix inconsistencies in information about the thief
cklin Apr 27, 2021
2b9fb79
Merge pull request #5786 from erik-krogh/anser
codeql-ci Apr 27, 2021
4ae3a23
Python: Limit absolute imports
tausbn Apr 27, 2021
310baab
Merge pull request #5740 from tamasvajk/feature/diag
tamasvajk Apr 28, 2021
e60628d
add global replacements using inverted char classes as a sanitizer fo…
erik-krogh Apr 27, 2021
160fa14
move `InfiniteRepetitionQuantifier` to Regexp.qll
erik-krogh Apr 28, 2021
d07c71c
unlimited repetition of a wildcard is also a wildcard
erik-krogh Apr 28, 2021
d5450f1
use `isWildcardLike` in `MetacharEscapeSanitizer`
erik-krogh Apr 28, 2021
73521e2
Merge pull request #5791 from tausbn/python-limit-absolute-imports
yoff Apr 28, 2021
9c5ad44
Merge pull request #5782 from erik-krogh/domFP
codeql-ci Apr 28, 2021
d288b92
Merge pull request #5790 from github/cklin-find-the-thief-conditions-…
shati-patel Apr 28, 2021
0376a13
Actions: Fix code scanning workflow
aeisenberg Apr 28, 2021
4d2db08
Merge pull request #5801 from github/aeisenberg/fix-codescanning
adityasharad Apr 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .github/workflows/close-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mark stale issues

on:
workflow_dispatch:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
if: github.repository == 'github/codeql'

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Comment or remove the `Stale` label in order to avoid having this issue closed in 7 days.'
close-issue-message: 'This issue was closed because it has been inactive for 7 days.'
days-before-stale: 14
days-before-close: 7
only-labels: awaiting-response

# do not mark PRs as stale
days-before-pr-stale: -1
days-before-pr-close: -1

# Uncomment for dry-run
# debug-only: true
# operations-per-run: 1000
11 changes: 8 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ jobs:

runs-on: ubuntu-latest

permissions:
contents: read
security-events: write
pull-requests: read

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@main
# Override language selection by uncommenting this and choosing your languages
with:
languages: csharp
Expand All @@ -34,7 +39,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@main

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -48,4 +53,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@main
5 changes: 5 additions & 0 deletions config/identical-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl3.qll",
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl4.qll",
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl5.qll",
"java/ql/src/semmle/code/java/dataflow/internal/DataFlowImpl6.qll",
"cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll",
"cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll",
"cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll",
Expand Down Expand Up @@ -56,6 +57,10 @@
"csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
"python/ql/src/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll"
],
"DataFlow Java/C# Flow Summaries": [
"java/ql/src/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll"
],
"SsaReadPosition Java/C#": [
"java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll",
"csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SsaReadPositionCommon.qll"
Expand Down
2 changes: 2 additions & 0 deletions cpp/change-notes/2021-04-13-arithmetic-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lgtm
* The queries cpp/tainted-arithmetic, cpp/uncontrolled-arithmetic, and cpp/arithmetic-with-extreme-values have been improved to produce fewer false positives.
2 changes: 2 additions & 0 deletions cpp/change-notes/2021-04-21-return-stack-allocated-object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codescanning
* The 'Pointer to stack object used as return value' (cpp/return-stack-allocated-object) query has been deprecated, and any uses should be replaced with `Returning stack-allocated memory` (cpp/return-stack-allocated-memory).
2 changes: 2 additions & 0 deletions cpp/change-notes/2021-26-04-more-sound-expr-might-overflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lgtm,codescanning
* The `exprMightOverflowPositively` and `exprMightOverflowNegatively` predicates from the `SimpleRangeAnalysis` library now recognize more expressions that might overflow.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ then replace all the relevant occurrences in the code.</p>
</li>
<li>
Mats Henricson and Erik Nyquist, <i>Industrial Strength C++</i>, published by Prentice Hall PTR (1997).
Chapter 5: Object Life Cycle, Rec 5.4 (<a href="http://mongers.org/industrial-c++/">PDF</a>).
Chapter 5: Object Life Cycle, Rec 5.4 (<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">PDF</a>).
</li>
<li>
<a href="https://www.securecoding.cert.org/confluence/display/c/DCL06-C.+Use+meaningful+symbolic+constants+to+represent+literal+values">DCL06-C. Use meaningful symbolic constants to represent literal values</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ constant.</p>
</li>
<li>
Mats Henricson and Erik Nyquist, <i>Industrial Strength C++</i>, published by Prentice Hall PTR (1997).
Chapter 5: Object Life Cycle, Rec 5.4 (<a href="http://mongers.org/industrial-c++/">PDF</a>).
Chapter 5: Object Life Cycle, Rec 5.4 (<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">PDF</a>).
</li>
<li>
<a href="https://www.securecoding.cert.org/confluence/display/c/DCL06-C.+Use+meaningful+symbolic+constants+to+represent+literal+values">DCL06-C. Use meaningful symbolic constants to represent literal values</a>
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Best Practices/SloppyGlobal.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Review the purpose of the each global variable flagged by this rule and update e

<li>
Mats Henricson and Erik Nyquist, <i>Industrial Strength C++</i>, published by Prentice Hall PTR (1997).
Chapter 1: Naming, Rec 1.1 (<a href="http://mongers.org/industrial-c++/">PDF</a>).
Chapter 1: Naming, Rec 1.1 (<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">PDF</a>).
</li>
<li>
<a href="http://www.learncpp.com/cpp-tutorial/42-global-variables/">Global variables</a>.
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Best Practices/UseOfGoto.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ this rule.
</li>
<li>
Mats Henricson and Erik Nyquist, <i>Industrial Strength C++</i>, Rule 4.6. Prentice Hall PTR, 1997.
(<a href="http://mongers.org/industrial-c++/">PDF</a>).
(<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">PDF</a>).
</li>
<li>
cplusplus.com: <a href="http://www.cplusplus.com/doc/tutorial/control/">Control Structures</a>.
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/Critical/ReturnStackAllocatedObject.ql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* @tags reliability
* security
* external/cwe/cwe-562
* @deprecated This query is not suitable for production use and has been deprecated. Use
* cpp/return-stack-allocated-memory instead.
*/

import semmle.code.cpp.pointsto.PointsTo
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Critical/ReturnValueIgnored.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Check the return value of functions that return status information.
<references>

<li>
M. Henricson and E. Nyquist, <i>Industrial Strength C++</i>, Chapter 12: Error handling. Prentice Hall PTR, 1997 (<a href="http://mongers.org/industrial-c++/">available online</a>).
M. Henricson and E. Nyquist, <i>Industrial Strength C++</i>, Chapter 12: Error handling. Prentice Hall PTR, 1997 (<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">available online</a>).
</li>
<li>
The CERT C Secure Coding Standard: <a href="https://www.securecoding.cert.org/confluence/display/perl/EXP32-PL.+Do+not+ignore+function+return+values">EXP32-PL. Do not ignore function return values</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ indication that there may be cases unhandled by the <code>switch</code> statemen
MSDN Library: <a href="https://docs.microsoft.com/en-us/cpp/cpp/switch-statement-cpp">switch statement (C++)</a>
</li>
<li>
M. Henricson and E. Nyquist, <i>Industrial Strength C++</i>, Chapter 4: Control Flow, Rec 4.5. Prentice Hall PTR, 1997 (<a href="http://mongers.org/industrial-c++/">available online</a>).
M. Henricson and E. Nyquist, <i>Industrial Strength C++</i>, Chapter 4: Control Flow, Rec 4.5. Prentice Hall PTR, 1997 (<a href="https://web.archive.org/web/20190919025638/https://mongers.org/industrial-c++/">available online</a>).
</li>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import cpp
import semmle.code.cpp.dataflow.EscapesTree
import semmle.code.cpp.models.interfaces.PointerWrapper
import semmle.code.cpp.dataflow.DataFlow

/**
Expand All @@ -39,6 +40,10 @@ predicate hasNontrivialConversion(Expr e) {
e instanceof ParenthesisExpr
)
or
// A smart pointer can be stack-allocated while the data it points to is heap-allocated.
// So we exclude such "conversions" from this predicate.
e = any(PointerWrapper wrapper).getAnUnwrapperFunction().getACallToThisFunction()
or
hasNontrivialConversion(e.getConversion())
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Metrics/Files/FTransitiveIncludes.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ build time: the more included files, the longer the compilation time.</p>
<a href="http://www.drdobbs.com/cpp/decoupling-c-header-files/212701130">Decoupling C Header Files</a>
</li>
<li>
<a href="https://wiki.hsr.ch/Prog3/files/overload72-FINAL_DesigningHeaderFiles.pdf">C++ Best Practice -
<a href="https://accu.org/journals/overload/14/72/griffiths_1995/">C++ Best Practice -
Designing Header Files</a>
</li>

Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/Metrics/Files/FTransitiveSourceIncludes.qhelp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ they are contributing to unnecessarily long build times and creating artificial
<a href="http://www.drdobbs.com/cpp/decoupling-c-header-files/212701130">Decoupling C Header Files</a>
</li>
<li>
<a href="https://wiki.hsr.ch/Prog3/files/overload72-FINAL_DesigningHeaderFiles.pdf">C++ Best Practice -
<a href="https://accu.org/journals/overload/14/72/griffiths_1995/">C++ Best Practice -
Designing Header Files</a>
</li>
</references>
Expand Down
1 change: 1 addition & 0 deletions cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ predicate outOfBoundsExpr(Expr expr, string kind) {

from Expr use, Expr origin, string kind
where
not use.getUnspecifiedType() instanceof PointerType and
outOfBoundsExpr(use, kind) and
tainted(origin, use) and
origin != use and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
while(flagsLoop)
{
...
if(flagsIf) break;
...
}while(flagsLoop); // BAD: when exiting through `break`, it is possible to get into an eternal loop.
...
while(flagsLoop)
{
...
if(flagsIf) break;
...
} // GOOD: correct cycle
...
if(intA+intB) return 1; // BAD: possibly no comparison
...
if(intA+intB>intC) return 1; // GOOD: correct comparison
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>In some situations, after code refactoring, parts of the old constructs may remain. They are correctly accepted by the compiler, but can critically affect program execution. For example, if you switch from `do {...} while ();` to `while () {...}` forgetting to remove the old construct completely, you get `while(){...}while();` which may be vulnerable. These code snippets look suspicious and require the developer's attention.</p>


</overview>
<recommendation>

<p>We recommend that you use more explicit code transformations.</p>

</recommendation>
<example>
<p>The following example demonstrates the erroneous and corrected sections of the code.</p>
<sample src="InsufficientControlFlowManagementAfterRefactoringTheCode.c" />

</example>
<references>

<li>
CWE Common Weakness Enumeration:
<a href="https://cwe.mitre.org/data/definitions/691.html"> CWE-691: Insufficient Control Flow Management</a>.
</li>

</references>
</qhelp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/**
* @name Errors After Refactoring
* @description --In some situations, after code refactoring, parts of the old constructs may remain.
* --They are correctly accepted by the compiler, but can critically affect program execution.
* --For example, if you switch from `do {...} while ();` to `while () {...}` with errors, you run the risk of running out of resources.
* --These code snippets look suspicious and require the developer's attention.
* @kind problem
* @id cpp/errors-after-refactoring
* @problem.severity warning
* @precision medium
* @tags correctness
* security
* external/cwe/cwe-691
*/

import cpp
import semmle.code.cpp.valuenumbering.HashCons
import semmle.code.cpp.valuenumbering.GlobalValueNumbering

/**
* Using `while` directly after the body of another` while`.
*/
class UsingWhileAfterWhile extends WhileStmt {
/**
* Using a loop call after another loop has finished running can result in an eternal loop.
* For example, perhaps as a result of refactoring, the `do ... while ()` loop was incorrectly corrected.
* Even in the case of deliberate use of such an expression, it is better to correct it.
*/
UsingWhileAfterWhile() {
exists(WhileStmt wh1 |
wh1.getStmt().getAChild*().(BreakStmt).(ControlFlowNode).getASuccessor().getASuccessor() =
this and
hashCons(wh1.getCondition()) = hashCons(this.getCondition()) and
this.getStmt() instanceof EmptyStmt
)
or
exists(ForStmt fr1 |
fr1.getStmt().getAChild*().(BreakStmt).(ControlFlowNode).getASuccessor().getASuccessor() =
this and
hashCons(fr1.getCondition()) = hashCons(this.getCondition()) and
this.getStmt() instanceof EmptyStmt
)
}
}

/**
* Using arithmetic in a condition.
*/
class UsingArithmeticInComparison extends BinaryArithmeticOperation {
/**
* Using arithmetic operations in a comparison operation can be dangerous.
* For example, part of the comparison may have been lost as a result of refactoring.
* Even if you deliberately use such an expression, it is better to add an explicit comparison.
*/
UsingArithmeticInComparison() {
this.getParent*() instanceof IfStmt and
not this.getAChild*().isConstant() and
not this.getParent*() instanceof Call and
not this.getParent*() instanceof AssignExpr and
not this.getParent*() instanceof ArrayExpr and
not this.getParent*() instanceof RemExpr and
not this.getParent*() instanceof AssignBitwiseOperation and
not this.getParent*() instanceof AssignArithmeticOperation and
not this.getParent*() instanceof EqualityOperation and
not this.getParent*() instanceof RelationalOperation
}

/** Holds when the expression is inside the loop body. */
predicate insideTheLoop() { exists(Loop lp | lp.getStmt().getAChild*() = this.getParent*()) }

/** Holds when the expression is used in binary operations. */
predicate workingWithValue() {
this.getParent*() instanceof BinaryBitwiseOperation or
this.getParent*() instanceof NotExpr
}

/** Holds when the expression contains a pointer. */
predicate workingWithPointer() {
this.getAChild*().getFullyConverted().getType() instanceof DerivedType
}

/** Holds when a null comparison expression exists. */
predicate compareWithZero() {
exists(Expr exp |
exp instanceof ComparisonOperation and
(
globalValueNumber(exp.getAChild*()) = globalValueNumber(this) or
hashCons(exp.getAChild*()) = hashCons(this)
) and
(
exp.(ComparisonOperation).getLeftOperand().getValue() = "0" or
exp.(ComparisonOperation).getRightOperand().getValue() = "0"
)
)
}

/** Holds when a comparison expression exists. */
predicate compareWithOutZero() {
exists(Expr exp |
exp instanceof ComparisonOperation and
(
globalValueNumber(exp.getAChild*()) = globalValueNumber(this) or
hashCons(exp.getAChild*()) = hashCons(this)
)
)
}
}

from Expr exp
where
exp instanceof UsingArithmeticInComparison and
not exp.(UsingArithmeticInComparison).workingWithValue() and
not exp.(UsingArithmeticInComparison).workingWithPointer() and
not exp.(UsingArithmeticInComparison).insideTheLoop() and
not exp.(UsingArithmeticInComparison).compareWithZero() and
exp.(UsingArithmeticInComparison).compareWithOutZero()
or
exists(WhileStmt wst | wst instanceof UsingWhileAfterWhile and exp = wst.getCondition())
select exp, "this expression needs your attention"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if(len>0 & memset(buf,0,len)) return 1; // BAD: `memset` will be called regardless of the value of the `len` variable. moreover, one cannot be sure that it will happen after verification
...
if(len>0 && memset(buf,0,len)) return 1; // GOOD: `memset` will be called after the `len` variable has been checked.
...
Loading