We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92f5a5f commit d1c8956Copy full SHA for d1c8956
1 file changed
cpp/ql/src/experimental/Security/CWE/CWE-266/IncorrectPrivilegeAssignment.ql
@@ -55,10 +55,11 @@ where
55
) and
56
(
57
fctmp.getArgument(1).getValue().matches("%a%") or
58
+ fctmp.getArgument(1).getValue().matches("%w%") or
59
// unfortunately cannot use numeric value here because // O_APPEND is defined differently on different OSes:
60
// https://github.com/red/red/blob/92feb0c0d5f91e087ab35fface6906afbf99b603/runtime/definitions.reds#L477-L491
61
// this may introduce false negatives
- fctmp.getArgument(1).getValueText().matches("%O_APPEND%")
62
+ fctmp.getArgument(1).(BitwiseOrExpr).getAChild*().getValueText().matches("O_CREAT")
63
64
fctmp.getNumberOfArguments() = 2 and
65
not fctmp.getArgument(0).getValue() = "/dev/null" and
0 commit comments