Skip to content

Commit 27c680e

Browse files
Edwinesbena
andauthored
Apply suggestions from code review
Co-authored-by: Esben Sparre Andreasen <[email protected]>
1 parent cef845a commit 27c680e

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

javascript/ql/src/experimental/Security/CWE-1004/CookieWithoutHttpOnly.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Cross-Site Scripting (XSS) vulnerability the cookie can be stolen by malicious s
88
</overview>
99
<recommendation>
1010

11-
<p>Protect sensitive cookies, such as related to authentication, by setting <code>HttpOnly</code> to <code>true</code> to make
11+
<p>Protect sensitive cookies, such as those related to authentication, by setting <code>HttpOnly</code> to <code>true</code> to make
1212
them not accessible to JavaScript.</p>
1313

1414
</recommendation>

javascript/ql/src/experimental/Security/CWE-1004/CookieWithoutHttpOnly.ql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* @name 'HttpOnly' attribute is not set to true
3-
* @description Omitting the 'HttpOnly' attribute for security sensitive data allows
4-
* malicious JavaScript to steal it in case of XSS vulnerability. Always set
5-
* 'HttpOnly' to 'true' to authentication related cookie to make it
6-
* not accessible by JavaScript.
3+
* @description Omitting the 'HttpOnly' attribute for security sensitive cookie data allows
4+
* malicious JavaScript to steal it in case of XSS vulnerabilities. Always set
5+
* 'HttpOnly' to 'true' for authentication related cookies to make them
6+
* inaccessible from JavaScript.
77
* @kind problem
88
* @problem.severity warning
99
* @precision high
@@ -17,4 +17,4 @@ import experimental.semmle.javascript.security.InsecureCookie::Cookie
1717

1818
from Cookie cookie
1919
where cookie.isAuthNotHttpOnly()
20-
select cookie, "Cookie attribute 'HttpOnly' is not set to true."
20+
select cookie, "Cookie attribute 'HttpOnly' is not set to true for this sensitive cookie."

javascript/ql/src/experimental/semmle/javascript/security/InsecureCookie.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Provides classes for reasoning about cookies added to response without the 'secure' or 'httponly' flag being set.
3-
* A cookie without the 'secure' flag being set can be intercepted and read by a malicious user.
4-
* A cookie without the 'httponly' flag being set can be read by an injected JavaScript
3+
* - A cookie without the 'secure' flag being set can be intercepted and read by a malicious user.
4+
* - A cookie without the 'httponly' flag being set can be read by maliciously injected JavaScript.
55
*/
66

77
import javascript
@@ -64,7 +64,7 @@ module Cookie {
6464
}
6565

6666
/**
67-
* Holds if the string contains sensitive auth keyword, but not antiforgery token.
67+
* Holds if `val` looks related to authentication, without being an anti-forgery token.
6868
*/
6969
bindingset[val]
7070
private predicate regexpMatchAuth(string val) {

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ class InvokeNode extends DataFlow::SourceNode {
165165
getOptionsArgument(i).hasPropertyWrite(name, result)
166166
}
167167

168-
/**
169-
* Holds if the `i`th argument of this invocation is an object literal set to `result`.
170-
*/
171168
pragma[noinline]
172169
private ObjectLiteralNode getOptionsArgument(int i) { result.flowsTo(getArgument(i)) }
173170

0 commit comments

Comments
 (0)