mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
Changed .qhelp
This commit is contained in:
@@ -12,64 +12,6 @@ This makes it easier for an attacker to intercept.</p>
|
||||
to an HTTP response (if the default value is `false`).</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
|
||||
<p>In the first example the `secure` flag is set to `false` using the express middleware `cookie-session`.
|
||||
In the second example the `secure` flag is set to `true` (it is set `false` by default for HTTP, `true` by default for HTTPS).</p>
|
||||
|
||||
<sample src="examples/cookie-session_bad.js" />
|
||||
<sample src="examples/cookie-session_good.js" />
|
||||
|
||||
</example>
|
||||
|
||||
<example>
|
||||
|
||||
<p>The first four examples show four ways of adding a cookie using the express middleware `express-session`.
|
||||
Since the default value for the flag `secure` is false, each example shows a possible scenario where a cookie is set with
|
||||
the `secure` to `false`.
|
||||
In the last example the `secure` flag is set to `true`.</p>
|
||||
|
||||
<sample src="examples/express-session_bad1_false.js" />
|
||||
<sample src="examples/express-session_bad2_notSet.js" />
|
||||
<sample src="examples/express-session_bad3_setEmpty.js" />
|
||||
<sample src="examples/express-session_bad4.js" />
|
||||
<sample src="examples/express-session_good.js" />
|
||||
|
||||
</example>
|
||||
|
||||
<example>
|
||||
|
||||
<p>The first two examples show two ways of adding a cookie using the method `response.cookie`.
|
||||
In both cases the `secure` flag is to `false`.
|
||||
In the last example the `secure` flag is set to `true`.</p>
|
||||
|
||||
<sample src="examples/express_response-cookie_bad1.js" />
|
||||
<sample src="examples/express_response-cookie_bad2.js" />
|
||||
<sample src="examples/express_response-cookie_good1.js" />
|
||||
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
|
||||
<p>The first example shows when the `secure` flag is set using the method `Set-Cookie` header of an `HTTP` response.
|
||||
In this case the `secure` flag is not set.
|
||||
In the last example the `secure` flag is set.</p>
|
||||
|
||||
<sample src="examples/httpserver_bad.js" />
|
||||
<sample src="examples/httpserver_good.js" />
|
||||
|
||||
</example>
|
||||
|
||||
<example>
|
||||
|
||||
<p>In the first example the `secure` flag is set to `false` using the `js-cookie` library.
|
||||
In the second example the `secure` flag is set to `true`.</p>
|
||||
|
||||
<sample src="examples/jsCookie_bad.js" />
|
||||
<sample src="examples/jsCookie_good.js" />
|
||||
|
||||
</example>
|
||||
|
||||
<references>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user