Commit Graph

409 Commits

Author SHA1 Message Date
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
Jeroen Ketema
a8b2805aeb Merge pull request #8246 from ihsinme/ihsinme-patch-82
CPP: Add query for CWE-754: Improper Check for Unusual or Exceptional Conditions when using functions scanf
2022-03-11 12:54:49 +01:00
ihsinme
ac8adeabf5 Update ImproperCheckReturnValueScanf.expected 2022-03-10 21:12:23 +03:00
ihsinme
623f3fbe21 Update test.cpp 2022-03-10 21:10:41 +03:00
ihsinme
a094e6f63b Update test.cpp 2022-03-10 17:56:34 +03:00
ihsinme
fa3ce61369 Update test.cpp 2022-03-10 17:54:03 +03:00
ihsinme
4b451cfee6 Update ImproperCheckReturnValueScanf.expected 2022-03-10 10:13:04 +03:00
ihsinme
5e23615be7 Update test.cpp 2022-03-10 10:12:29 +03:00
Mathias Vorreiter Pedersen
c7d624d314 Merge pull request #8247 from ihsinme/ihsinme-patch-80
CPP: Add query for CWE-190: Integer Overflow or Wraparound when using transform after operation
2022-03-07 11:00:29 +00:00
Geoffrey White
e7dca435a9 Merge pull request #6950 from ihsinme/ihsinme-patch-078
CPP: Add query for CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
2022-03-07 10:55:29 +00:00
Geoffrey White
17cd4d86f1 Fix tests. 2022-03-04 12:27:48 +00:00
ihsinme
467136c173 Create ExposureSensitiveInformationUnauthorizedActor.expected 2022-03-04 00:02:44 +03:00