Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d1c4a1

Browse files
committed
document that the WeakFilePermissions access predicate should return at most one value
1 parent 89be8d8 commit 0d1c4a1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ql/src/queries/security/cwe-732/WeakFilePermissions.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ bindingset[p]
4040
string access(int p) {
4141
p.bitAnd(2) != 0 and result = "writable"
4242
or
43+
// report only the "most permissive" permission, i.e. report the file as
44+
// readable only if it is not also writable
4345
p.bitAnd(2) = 0 and p.bitAnd(4) != 0 and result = "readable"
4446
}
4547

0 commit comments

Comments
 (0)