-
Notifications
You must be signed in to change notification settings - Fork 6
Test suppressions #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,8 +67,9 @@ void connect(HttpServletRequest req){ | |
| class Connector6 { | ||
| @javax.jws.WebMethod | ||
| void connect(HttpServletRequest req){ | ||
| javax.servlet.http.Cookie cook = new Cookie("cookie"); | ||
| cook.setSecure(false); | ||
| javax.servlet.http.Cookie cook = new Cookie("cookie"); //another comment | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| cook.setSecure(false); //and another | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| //and another | ||
| req.addCookie(cook); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File: main.java | Checkov ID: CKV3_SAST_16
Description
CWE:
CWE-1004: Sensitive Cookie Without 'HttpOnly' FlagOWASP:
A05:2021-Security MisconfigurationThis policy is targeting the creation of HTTP cookies without the "HttpOnly" flag in Java code. The HttpOnly flag is an important security feature that prevents client-side scripts from reading the contents of the cookie. When this flag is not set, it could potentially lead to disclosure of the cookie's contents in the event of a Cross-Site Scripting (XSS) attack.
Here's an example of violating code:
In this example, a new cookie is created with a provided name and value, but the HttpOnly flag is not set.