Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
a378744
Github actions updates (#139)
jacob-ronstadt May 24, 2024
468e003
Update build-codeql.yaml to allow publish step to fail for outside PRs
jacob-ronstadt Jun 13, 2024
ac8f77f
Update build-codeql.yaml (#141)
jacob-ronstadt Jun 14, 2024
94b8ca8
Update build-codeql.yaml (#142)
jacob-ronstadt Jun 27, 2024
2034189
Initial Batch of Windows Filtering Platform Queries for Static Contra…
houha2 Jun 27, 2024
c282407
codeql port of C28648. TODO needs tests
jacob-ronstadt Aug 16, 2024
ce7d70c
Revert "codeql port of C28648. TODO needs tests"
jacob-ronstadt Aug 16, 2024
c15579b
OperandAssignment: CodeQL Port of C28129 (#121)
jacob-ronstadt Aug 23, 2024
540f0d4
IoInitializeTimerCall: CodeQL port of C28133 (#123)
jacob-ronstadt Aug 23, 2024
c2febb9
IrqlIllegalValue: CodeQL port of c28151 (#144)
jacob-ronstadt Aug 23, 2024
c8369c9
NullPointerCharacterAssignment: CodeQL port of C28730 (#146)
jacob-ronstadt Aug 23, 2024
786fda0
FloatSafeExit: CodeQL port of C28162 (#147)
jacob-ronstadt Aug 23, 2024
9dc8063
FloatUnsafeExit: CodeQL port of C28161 (#148)
jacob-ronstadt Aug 23, 2024
f227ac0
PointerVariableSize: CodeQL port of C28132 (#143)
jacob-ronstadt Aug 23, 2024
735f49f
NtstatusExplicitCast3: CodeQL port of C28716 (#151)
jacob-ronstadt Aug 23, 2024
d71fb93
NtstatusExplicitCast2: CodeQL port of C29715 (#150)
jacob-ronstadt Aug 23, 2024
3165575
NtstatusExplicitCast: CodeQL port of C28714 (#149)
jacob-ronstadt Aug 23, 2024
7edf413
CurrentFunctionTypeNotCorrect: CodeQL port of C28101 (#124)
jacob-ronstadt Aug 23, 2024
4eab8e3
InvalidFunctionPointerAnnotation: CodeQL port of C28165 (#145)
jacob-ronstadt Aug 23, 2024
ef48413
FloatHardwareStateProtection: CodeQL port of c28110 (#130)
jacob-ronstadt Aug 23, 2024
53bb6fe
DriverEntrySaveBuffer: Port of c28131 (#122)
jacob-ronstadt Aug 23, 2024
0488826
IRPStackEntryCopy: CodeQL port of c28114 (#120)
jacob-ronstadt Aug 23, 2024
e5c16d7
update ported_driver_ca_checks.qls with new queries
jacob-ronstadt Aug 23, 2024
713331e
fix typo
jacob-ronstadt Aug 23, 2024
60874fd
updates to test script
jacob-ronstadt Aug 26, 2024
f47586b
Driver isolation queries (#152)
jacob-ronstadt Sep 25, 2024
129bcb5
update config file to include other isolation queries
jacob-ronstadt Sep 26, 2024
39f0f5d
update build script
jacob-ronstadt Sep 26, 2024
0c54c94
update sarif files for isolation queries
jacob-ronstadt Sep 26, 2024
9c1627b
Update codeql-config.yml
jacob-ronstadt Sep 27, 2024
e49efef
github action updates to get latest codeql version (#154)
jacob-ronstadt Nov 11, 2024
d623cf8
minor updates
jacob-ronstadt Nov 12, 2024
ece9421
fix compare issue with backslashes in latest codeql version
jacob-ronstadt Nov 12, 2024
3ef295d
Irql.qll updates to expand ability to detect function IRQL requiremen…
jacob-ronstadt Jan 6, 2025
2a7c167
update uses of dataflow to use latest library (#155)
jacob-ronstadt Jan 10, 2025
c7f9de9
StaticInitializer: CodeQL port of C28651 (#156)
jacob-ronstadt Jan 30, 2025
fa33730
Add APIs to ExtendedDeprecatedApis for Codeql port of c28727 (#163)
jacob-ronstadt Jan 30, 2025
a9ed412
Driver apps framework (#165)
jacob-ronstadt Jan 30, 2025
267b3e4
IrqlFunctionNotAnnotated: codeql port of c28167 (#160)
jacob-ronstadt Jan 30, 2025
9d62d31
IrqlLoweredImproperly: Codeql port of c28141 (#157)
jacob-ronstadt Jan 30, 2025
528c675
IrqlFloatStateMismatch: CodeQL port of C28111 (#161)
jacob-ronstadt Jan 30, 2025
9eb68b3
IrqlCancelRoutine: CodeQL port of c28144 (#162)
jacob-ronstadt Jan 30, 2025
3fb0ff0
IrqlAnnotationIssue: CodeQL port of c28153 (#158)
jacob-ronstadt Jan 30, 2025
fa6d266
IrqlInconsistentWithRequired: CodeQL port of C28166 (#159)
jacob-ronstadt Jan 30, 2025
8ce22c1
AnnotationSyntax: CodeQL port of c28266 (#164)
jacob-ronstadt Jan 30, 2025
aa5a9fc
CodeQL port of C28650
jacob-ronstadt Feb 7, 2025
798514b
add build_database_only option to build script
jacob-ronstadt Feb 7, 2025
c997c83
update gitignore
jacob-ronstadt Feb 7, 2025
87c7a9d
ImportantFunctionCallOptimizedOut: port of c28625 (#167)
jacob-ronstadt Feb 7, 2025
bba37ab
InvalidFunctionClassTypedef: Codeql port of c28268 (#170)
jacob-ronstadt Feb 7, 2025
eeaf255
StrictTypeMatch: Codeql port of c28139 (#169)
jacob-ronstadt Feb 7, 2025
77fb9a1
MultipleFunctionClassAnnotations: Port of C28177 (#168)
jacob-ronstadt Feb 8, 2025
aeb1987
UnsafeCallInGlobalinit: CodeQL port of C28637 (#166)
jacob-ronstadt Feb 10, 2025
5066a0e
Update opaqueid in ImproperNotOperatorOnZero.ql
jacob-ronstadt Feb 10, 2025
6aefd5c
update build script and repo structure
jacob-ronstadt Feb 11, 2025
01eb74d
ported_driver_ca_checks.qls to use tag ca_ported and update ported ca…
jacob-ronstadt Feb 11, 2025
da3535a
update dvl_tests.ps1
jacob-ronstadt Feb 11, 2025
0724fc5
update qlpack version and fix path error
jacob-ronstadt Feb 11, 2025
6b424ee
bug fix in AnnotationSyntax.ql
jacob-ronstadt Feb 20, 2025
6748f70
update DriverEntrySaveBuffer.ql to only look at registrypath and not …
jacob-ronstadt Feb 20, 2025
78b7b70
remove false positives
jacob-ronstadt Feb 21, 2025
9629358
remove false positives
jacob-ronstadt Feb 21, 2025
8edf3f1
remove false positives
jacob-ronstadt Feb 21, 2025
335b284
Add possible false positive note to DriverEntrySaveBuffer.qhelp
jacob-ronstadt Feb 21, 2025
880c39a
remove non-SAL parameters due to false positives
jacob-ronstadt Feb 21, 2025
8455a12
update message
jacob-ronstadt Feb 21, 2025
d99af75
update test results to match query update
jacob-ronstadt Feb 24, 2025
1bde64e
fix query id
jacob-ronstadt Feb 27, 2025
0ba716b
Update codeql-config.yml
jacob-ronstadt Mar 21, 2025
c88a2a1
Update codeql-config.yml
jacob-ronstadt Mar 21, 2025
f1d346f
Query suite updates (#172)
jacob-ronstadt Mar 21, 2025
4f04d8c
Update codeql-config.yml
jacob-ronstadt Mar 21, 2025
06ef37d
Update codeql-config.yml
jacob-ronstadt Mar 21, 2025
4246e2a
Update codeql-config.yml
jacob-ronstadt Mar 21, 2025
b62be55
Must run query update (#173)
jacob-ronstadt May 9, 2025
0bb0146
Jacob ronstadt/mustrun (#174)
jacob-ronstadt May 28, 2025
03de642
Update README.md
jacob-ronstadt Jun 10, 2025
35b9f55
Actions azure file storage fix (#176)
jacob-ronstadt Jun 10, 2025
35d8ba7
Fix query health action (#177)
jacob-ronstadt Jun 23, 2025
df3da19
Improve recommendations in ExtendedDeprecatedApis for strlen (#179)
NateD-MSFT Jun 27, 2025
4700593
Merge branch 'main' into development
NateD-MSFT Jun 27, 2025
e6e6eb1
update mustfix and recommended suites (#182)
jacob-ronstadt Jul 14, 2025
37d0652
Merge branch 'main' into development
jacob-ronstadt Jul 14, 2025
452fd53
Jacob ronstadt/mustfix updates (#183)
jacob-ronstadt Jul 15, 2025
631ffa2
Update build-codeql.yaml
jacob-ronstadt Jul 16, 2025
acb9614
Merge branch 'main' into development
jacob-ronstadt Jul 16, 2025
d0df031
add back old suite files for backward compatibility
jacob-ronstadt Jul 16, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/build-codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
inlineScript: |
Update-AzConfig -DisplayBreakingChangeWarning $false
$context = New-AzStorageContext -StorageAccountName "$env:ACCOUNT_NAME" -UseConnectedAccount -EnableFileBackupRequestIntent
Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "health-diffdetailedfunctiontestresults.xlsx" -Context $context
Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "health-diffdetailedfunctiontestresults.xlsx" -Context $context -Force
exit 1


Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
azPSVersion: latest
inlineScript: |
$context = New-AzStorageContext -StorageAccountName "$env:ACCOUNT_NAME" -UseConnectedAccount -EnableFileBackupRequestIntent
Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "version-diffdetailedfunctiontestresults.xlsx" -Context $context
Set-AzStorageFileContent -ShareName "$env:SHARE_NAME" -Source "diffdetailedfunctiontestresults.xlsx" -Path "version-diffdetailedfunctiontestresults.xlsx" -Context $context -Force
exit 1
- name: Save Latest Version
if: ${{ hashFiles('diffdetailedfunctiontestresults.xlsx') == '' }} # Only if there were no differences
Expand Down
2 changes: 1 addition & 1 deletion src/qlpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT license.

name: microsoft/windows-drivers
version: 1.6.0
version: 1.7.0
dependencies:
codeql/cpp-all: ^4.2.0
microsoft/cpp-queries: ^0.0.4
Expand Down
25 changes: 24 additions & 1 deletion src/windows-driver-suites/mustfix.qls
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,30 @@
- include:
query path:
- Likely Bugs/Arithmetic/BadAdditionOverflowCheck.ql
- Likely Bugs/Format/WrongNumberOfFormatArguments.ql
- Likely Bugs/Memory Management/PointerOverflow.ql
- Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql
- Likely Bugs/OO/UnsafeUseOfThis.ql
- Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql
- Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql
- Likely Bugs/Underspecified Functions/TooFewArguments.ql
- Microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql
- Microsoft/Likely Bugs/Drivers/IncorrectUsageOfRtlCompareMemory.ql
- Microsoft/Security/Cryptography/BannedEncryption.ql
- Microsoft/Security/Cryptography/BannedModesCAPI.ql
- Microsoft/Security/Cryptography/BannedModesCNG.ql
- Microsoft/Security/Cryptography/HardcodedIVCNG.ql
- Microsoft/Security/MemoryAccess/EnumIndex/UncheckedBoundsEnumAsIndex.ql
- Security/CWE/CWE-078/ExecTainted.ql
- Security/CWE/CWE-114/UncontrolledProcessOperation.ql
- Security/CWE/CWE-120/BadlyBoundedWrite.ql
- Security/CWE/CWE-120/OverrunWrite.ql
- Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql
- Security/CWE/CWE-170/ImproperNullTerminationTainted.ql
- Security/CWE/CWE-190/ComparisonWithWiderType.ql
- Security/CWE/CWE-253/HResultBooleanConversion.ql
- Security/CWE/CWE-253/HResultBooleanConversion.ql
- Security/CWE/CWE-327/OpenSslHeartbleed.ql
- Security/CWE/CWE-676/DangerousFunctionOverflow.ql
- Security/CWE/CWE-676/DangerousUseOfCin.ql
- Security/CWE/CWE-704/WcharCharConversion.ql
- Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql
92 changes: 69 additions & 23 deletions src/windows-driver-suites/recommended.qls
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,77 @@

- description: Recommended and required queries for Windows Drivers.
- import: windows-driver-suites/mustfix.qls
- queries: .
from: microsoft/windows-drivers
- include:
query path:
- drivers/general/queries/AnnotationSyntax/AnnotationSyntax.ql
- drivers/general/queries/CurrentFunctionTypeNotCorrect/CurrentFunctionTypeNotCorrect.ql
- drivers/general/queries/DefaultPoolTag/DefaultPoolTag.ql
- drivers/general/queries/DriverEntrySaveBuffer/DriverEntrySaveBuffer.ql
- drivers/general/queries/ExaminedValue/ExaminedValue.ql
- drivers/general/queries/ExtendedDeprecatedApis/ExtendedDeprecatedApis.ql
- drivers/general/queries/IRPStackEntryCopy/IRPStackEntryCopy.ql
- drivers/general/queries/ImportantFunctionCallOptimizedOut/ImportantFunctionCallOptimizedOut.ql
- drivers/general/queries/ImproperNotOperatorOnZero/ImproperNotOperatorOnZero.ql
- drivers/general/queries/InvalidFunctionClassTypedef/InvalidFunctionClassTypedef.ql
- drivers/general/queries/InvalidFunctionPointerAnnotation/InvalidFunctionPointerAnnotation.ql
- drivers/general/queries/IoInitializeTimerCall/IoInitializeTimerCall.ql
- drivers/general/queries/IrqlAnnotationIssue/IrqlAnnotationIssue.ql
- drivers/general/queries/IrqlCancelRoutine/IrqlCancelRoutine.ql
- drivers/general/queries/IrqlFloatStateMismatch/IrqlFloatStateMismatch.ql
- drivers/general/queries/IrqlNotSaved/IrqlNotSaved.ql
- drivers/general/queries/IrqlNotUsed/IrqlNotUsed.ql
- drivers/general/queries/IrqlSetTooHigh/IrqlSetTooHigh.ql
- drivers/general/queries/IrqlSetTooLow/IrqlSetTooLow.ql
- drivers/general/queries/IrqlTooHigh/IrqlTooHigh.ql
- drivers/general/queries/IrqlTooLow/IrqlTooLow.ql
- drivers/general/queries/KeSetEventPageable/KeSetEventPageable.ql
- drivers/general/queries/MultithreadedAVCondition/MultithreadedAVCondition.ql
- drivers/general/queries/NtstatusExplicitCast/NtstatusExplicitCast.ql
- drivers/general/queries/NtstatusExplicitCast2/NtstatusExplicitCast2.ql
- drivers/general/queries/NtstatusExplicitCast3/NtstatusExplicitCast3.ql
- drivers/general/queries/NullCharacterPointerAssignment/NullCharacterPointerAssignment.ql
- drivers/general/queries/OperandAssignment/OperandAssignment.ql
- drivers/general/queries/PointerVariableSize/PointerVariableSize.ql
- drivers/general/queries/PoolTagIntegral/PoolTagIntegral.ql
- drivers/general/queries/RoleTypeCorrectlyUsed/RoleTypeCorrectlyUsed.ql
- drivers/general/queries/RoutineFunctionTypeNotExpected/RoutineFunctionTypeNotExpected.ql
- drivers/general/queries/StrSafe/StrSafe.ql
- drivers/general/queries/StrictTypeMatch/StrictTypeMatch.ql
- drivers/wdm/queries/IllegalFieldAccess/IllegalFieldAccess.ql
- drivers/wdm/queries/IllegalFieldAccess2/IllegalFieldAccess2.ql
- drivers/wdm/queries/IllegalFieldWrite/IllegalFieldWrite.ql
- drivers/wdm/queries/InitNotCleared/InitNotCleared.ql
- drivers/wdm/queries/KeWaitLocal/KeWaitLocal.ql
- drivers/wdm/queries/MultiplePagedCode/MultiplePagedCode.ql
- drivers/wdm/queries/ObReferenceMode/ObReferenceMode.ql
- drivers/wdm/queries/OpaqueMdlUse/OpaqueMdlUse.ql
- drivers/wdm/queries/OpaqueMdlWrite/OpaqueMdlWrite.ql
- drivers/wdm/queries/PendingStatusError/PendingStatusError.ql
- drivers/wdm/queries/WrongDispatchTableAssignment/WrongDispatchTableAssignment.ql
- microsoft/Likely Bugs/Boundary Violations/PaddingByteInformationDisclosure.ql
- microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql
- microsoft/Likely Bugs/Conversion/InfiniteLoop.ql
- microsoft/Likely Bugs/Memory Management/UseAfterFree/UseAfterFree.ql
- microsoft/Likely Bugs/UninitializedPtrField.ql
- microsoft/Security/Crytpography/HardcodedIVCNG.ql
- queries: .
from: microsoft/cpp-queries
version: 0.0.4
- include:
query path:
- Likely Bugs/Format/WrongNumberOfFormatArguments.ql
- Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql
- Likely Bugs/OO/UnsafeUseOfThis.ql
- Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql
- Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql
- Microsoft/Likely Bugs/Conversion/BadOverflowGuard.ql
- Microsoft/Likely Bugs/Drivers/IncorrectUsageOfRtlCompareMemory.ql
- Microsoft/Security/Cryptography/BannedEncryption.ql
- Microsoft/Security/Cryptography/BannedModesCAPI.ql
- Microsoft/Security/Cryptography/BannedModesCNG.ql
- Microsoft/Security/Cryptography/HardcodedIVCNG.ql
- Microsoft/Security/MemoryAccess/EnumIndex/UncheckedBoundsEnumAsIndex.ql
- Security/CWE/CWE-078/ExecTainted.ql
- Security/CWE/CWE-114/UncontrolledProcessOperation.ql
- Security/CWE/CWE-120/BadlyBoundedWrite.ql
- Security/CWE/CWE-120/OverrunWrite.ql
- Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql
- Security/CWE/CWE-170/ImproperNullTerminationTainted.ql
- Security/CWE/CWE-327/OpenSslHeartbleed.ql
- Security/CWE/CWE-676/DangerousFunctionOverflow.ql
- Security/CWE/CWE-676/DangerousUseOfCin.ql
- Security/CWE/CWE-704/WcharCharConversion.ql
- Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql
- Best Practices/Likely Errors/OffsetUseBeforeRangeCheck.ql
- Likely Bugs/Arithmetic/IntMultToLong.ql
- Likely Bugs/Arithmetic/SignedOverflowCheck.ql
- Likely Bugs/Conversion/CastArrayPointerArithmetic.ql
- Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.ql
- Likely Bugs/Memory Management/SuspiciousSizeof.ql
- Likely Bugs/Memory Management/UninitializedLocal.ql
- Security/CWE/CWE-121/UnterminatedVarargsCall.ql
- Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql
- Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql
- Security/CWE/CWE-468/IncorrectPointerScaling.ql
- Security/CWE/CWE-468/IncorrectPointerScalingVoid.ql
- Security/CWE/CWE-676/PotentiallyDangerousFunction.ql
- Security/CWE/CWE-119/OverflowBuffer.ql
5 changes: 5 additions & 0 deletions suites/windows_driver_mustfix.qls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

- description: This suite is deprecated, please use the suite file below.
- import: windows-driver-suites/mustfix.qls
5 changes: 5 additions & 0 deletions suites/windows_driver_recommended.qls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

- description: This suite is deprecated, please use the suite file below.
- import: windows-driver-suites/recommended.qls
Loading