diff --git a/.gitignore b/.gitignore index 4b055e55a09..effd82ac428 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ /.vs/ql/v15/Browse.VC.opendb /.vs/ql/v15/Browse.VC.db /.vs/ProjectSettings.json +/.vs/ql5/v15/Browse.VC.opendb +/.vs/ql5/v15/Browse.VC.db +/.vs/ql5/v15/.suo diff --git a/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql b/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql index 19551a46c5b..a7d17f4de32 100644 --- a/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql +++ b/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql @@ -1,6 +1,6 @@ /** - * @name Setting a SECURITY_DESCRIPTOR’s DACL to NULL - * @description Setting a SECURITY_DESCRIPTOR’s DACL to NULL will result in an unprotected object. + * @name Setting a SECURITY_DESCRIPTOR's DACL to NULL + * @description Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object. * If the DACL that belongs to the security descriptor of an object is set to NULL, a null DACL is created. * A null DACL grants full access to any user who requests it; * normal security checking is not performed with respect to the object. @@ -49,12 +49,12 @@ class SetSecurityDescriptorDaclFunctionConfiguration extends DataFlow::Configura from SetSecurityDescriptorDaclFunctionCall call, string message where exists( NullValue nullExpr | - message = "Setting a SECURITY_DESCRIPTOR’s DACL to NULL will result in an unprotected object." | + message = "Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object." | call.getArgument(1).getValue().toInt() != 0 and call.getArgument(2) = nullExpr ) or exists( Expr constassign, VariableAccess var, SetSecurityDescriptorDaclFunctionConfiguration config | - message = "Setting a SECURITY_DESCRIPTOR’s DACL using variable " + var + " that is set to NULL will result in an unprotected object." | + message = "Setting a SECURITY_DESCRIPTOR's DACL using variable " + var + " that is set to NULL will result in an unprotected object." | var = call.getArgument(2) and config.hasFlow(DataFlow::exprNode(constassign), DataFlow::exprNode(var)) ) diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.expected index dd4b1db43c1..b759bd907d8 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.expected @@ -1,2 +1,2 @@ -| UnsafeDaclSecurityDescriptor.cpp:69:6:69:30 | call to SetSecurityDescriptorDacl | Setting a SECURITY_DESCRIPTOR\u2019s DACL to NULL will result in an unprotected object. | -| UnsafeDaclSecurityDescriptor.cpp:75:6:75:30 | call to SetSecurityDescriptorDacl | Setting a SECURITY_DESCRIPTOR\u2019s DACL using variable pDacl that is set to NULL will result in an unprotected object. | +| UnsafeDaclSecurityDescriptor.cpp:69:6:69:30 | call to SetSecurityDescriptorDacl | Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object. | +| UnsafeDaclSecurityDescriptor.cpp:75:6:75:30 | call to SetSecurityDescriptorDacl | Setting a SECURITY_DESCRIPTOR's DACL using variable pDacl that is set to NULL will result in an unprotected object. |