Commit Graph

470 Commits

Author SHA1 Message Date
erik-krogh
33165f4f55 CPP: update expected output 2022-09-23 14:45:59 +02:00
Mathias Vorreiter Pedersen
ce3654c6ec C++: Make ql-for-ql happy. 2022-09-23 13:07:07 +01:00
Mathias Vorreiter Pedersen
162ec2884e C++: Also fix 'OverrunWriteProductFlow.ql' 2022-09-23 12:59:27 +01:00
Mathias Vorreiter Pedersen
494afdde96 C++: Accept test changes. 2022-09-23 12:21:31 +01:00
Mathias Vorreiter Pedersen
6d06234048 C++: Add testcase demonstrating missing result for 'cpp/invalid-pointer-deref' query. 2022-09-23 11:41:16 +01:00
Mathias Vorreiter Pedersen
c4afb3a2b5 Merge branch 'main' into further-work-on-buffer-over-queries 2022-09-22 16:35:52 +01:00
Robert Marsh
32ab636c77 C++: adjust test so size flows from malloc to field 2022-09-21 12:43:44 -04:00
Robert Marsh
fcd0bb13b3 C++: add paths to ArrayAccessProductFlow 2022-09-21 12:37:31 -04:00
Mathias Vorreiter Pedersen
3e6576bfaf C++: Add example of missing result. 2022-09-18 12:18:04 +01:00
Mathias Vorreiter Pedersen
d1cf688abf C++: Fix test function naming. 2022-09-18 12:17:46 +01:00
Mathias Vorreiter Pedersen
4482669d7e C++: Add a new 'InvalidPointerDeref' query to experimental. 2022-09-15 17:47:15 +01:00
Mathias Vorreiter Pedersen
b8a5aa5d85 C++: Fix a couple of range analysis issues:
1. The new query is expecting pointer arithmetic operations to generate
range-analysis bounds, but this wasn't true on main.
2. The bounds generated by `boundFlowCond` was incorrectly inferred as
non-strict when comparing a pointers (unlike when comparing values of
integral types). This gave FPs in the new query.

This also fixes a couple of missing results in existing queries that
use the new range-analysis library.
2022-09-15 17:46:52 +01:00
ihsinme
50105c1f6d create new branchihsinme-patch-111 in fork 2022-09-15 06:35:42 +00:00
Mathias Vorreiter Pedersen
c7ccff2e20 C++: Accept test changes. 2022-09-13 12:11:22 +01:00
Mathias Vorreiter Pedersen
011d15aca3 C++: Accept test changes. 2022-09-07 14:56:08 +01:00
Robert Marsh
ca2694ae1d C++: exclude end pointers in iterator-style loops 2022-09-01 17:42:19 -04:00
intrigus
dabccd8686 Add query for tainted wordexp calls. 2022-08-16 23:56:50 +02:00
Robert Marsh
56eacce320 C++: restrict to end-of-allocation pointers 2022-08-16 17:52:06 -04:00
Robert Marsh
93de8e2308 C++: fix missing bounds in exp range analysis 2022-08-16 17:44:51 -04:00
Robert Marsh
e4d0e7431c C++: some experimental product flow queries 2022-08-16 17:44:46 -04:00
Geoffrey White
db8a3107b3 Merge pull request #9089 from ihsinme/ihsinme-patch-87
CPP: Add query for CWE-125 Out-of-bounds Read with different interpretation of the string when use mbtowc
2022-08-09 09:31:32 +01:00
ihsinme
9b5154f878 Update and rename DangerousUseMbtowc.qlref to DangerousWorksWithMultibyteOrWideCharacters.qlref 2022-08-08 18:39:10 +03:00
ihsinme
bce395f201 Rename DangerousUseMbtowc.expected to DangerousWorksWithMultibyteOrWideCharacters.expected 2022-08-08 18:38:24 +03:00
ihsinme
e77a989133 Update DangerousUseMbtowc.expected 2022-07-12 20:22:31 +03:00
Geoffrey White
f29104ccce C++: Accept test results. 2022-07-12 16:49:04 +01:00
ihsinme
4e28887689 Create test3.cpp 2022-07-04 11:13:07 +03:00
ihsinme
1ce42dcd30 Create test2.cpp 2022-07-04 11:12:34 +03:00
ihsinme
6d800de377 Create test1.cpp 2022-07-04 11:11:49 +03:00
Geoffrey White
20c3182437 Merge pull request #9087 from ihsinme/ihsinme-patch-88
CPP: Add query for CWE-670: Always-Incorrect Control Flow Implementation when use SSL_shutdown
2022-06-23 09:16:55 +01:00
ihsinme
77e4d05ea3 Update test.cpp 2022-06-02 14:33:59 +03:00
ihsinme
872dd0d59f Update DangerousUseMbtowc.expected 2022-06-02 14:33:06 +03:00
Geoffrey White
2bcf7e17c8 Understand syscalls better. 2022-05-26 14:01:09 +01:00
Geoffrey White
e3ea7751d1 C++: Define sources better so that we catch all the test cases. 2022-05-26 12:44:17 +01:00
ihsinme
5a9061e45b create new branchihsinme-patch-102 in fork 2022-05-21 14:19:34 +00:00
Geoffrey White
265500faa8 Merge pull request #8800 from geoffw0/unsafeput
C++: Add a test for experimental query NoCheckBeforeUnsafePutUser.ql.
2022-05-09 16:20:19 +01:00
ihsinme
a7c69ba6ab create new branchihsinme-patch-87 in fork 2022-05-09 13:15:27 +00:00
ihsinme
09cd168197 create new branchihsinme-patch-88 in fork 2022-05-09 13:05:06 +00:00
Geoffrey White
28dca3fa9f Merge pull request #8245 from ihsinme/ihsinme-patch-67
CPP: Add query for CWE-476: NULL Pointer Dereference when using exception handling blocks
2022-05-09 12:26:20 +01:00
ihsinme
6dec1182bf Update DangerousUseOfExceptionBlocks.expected 2022-05-05 19:17:31 +03:00
ihsinme
185a60f034 Update test.cpp 2022-05-05 19:16:54 +03:00
Geoffrey White
40da7a1055 C++: Add a test of NoCheckBeforeUnsafePutUser.ql. 2022-04-21 16:55:50 +01:00
Porcupiney Hairs
85c751cb7f CPP: PAM Authorization Bypass
This PR is similar to my other PRs for
[Python](https://github.com/github/codeql/pull/8595) and
[Golang](https://github.com/github/codeql-go/pull/709).

This PR aims to detect instances were an initiated PAM Transaction invokes the `pam_authenticate` method but does not invoke a call to the pam_acct_mgmt` method. This is bad as a call to `pam_authenticate` only verifies the users credentials. It does not check if the user account is still is a valid state.

If only a call to `pam_authenticate` is used to verify the user, a user with an expired account password would still be able to login. This can be prevented by calling the `pam_acct_mgmt` function after a `pam_authenticate` function.
2022-04-19 18:24:19 +05:30
ihsinme
275b29a288 Update DangerousUseOfExceptionBlocks.expected 2022-04-05 22:48:11 +03:00
ihsinme
22cf3f7b20 Update test.cpp 2022-03-21 09:50:30 +03:00
ihsinme
ccbb4434de Update DangerousUseOfExceptionBlocks.expected 2022-03-16 09:54:35 +03:00
ihsinme
cd561dd19c Update test.cpp 2022-03-16 09:53:45 +03:00
Mathias Vorreiter Pedersen
57922f56ee Merge pull request #8424 from ihsinme/ihsinme-patch-fix077
Detection reduction on request
2022-03-15 16:17:47 +00:00
ihsinme
e99eaeb256 Apply suggestions from code review
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2022-03-15 08:53:00 +03:00
ihsinme
62381d0762 Update test.cpp 2022-03-14 09:36:28 +03:00
ihsinme
de92356c88 Update InsecureTemporaryFile.expected 2022-03-14 09:35:03 +03:00