gitlab.find_sec_bugs.INSECURE_COOKIE-1

unknown
Download Count*
License

"A new cookie is created without the Secure flag set. The Secure flag is a directive to the browser to make sure that the cookie is not sent for insecure communication (http://)"

Run Locally

Run in CI

Defintion

rules:
  - id: find_sec_bugs.INSECURE_COOKIE-1
    pattern-either:
      - patterns:
          - pattern: |
              javax.servlet.http.Cookie $C = new Cookie(..., ...);
              ...
              (HttpServletResponse $RESP).addCookie($C);
          - pattern-not-inside: |
              javax.servlet.http.Cookie $C = new Cookie(..., ...);
              ...
              $C.setSecure(true);
              ...
              (HttpServletResponse $RESP).addCookie($C);
      - pattern: (javax.servlet.http.Cookie $C).setSecure(false);
    message: >
      "A new cookie is created without the Secure flag set. The Secure flag is a
      directive to the

      browser to make sure that the cookie is not sent for insecure communication (http://)"
    languages:
      - java
    severity: WARNING
    metadata:
      category: security
      cwe: "CWE-539: Information Exposure Through Persistent Cookies"
      technology:
        - java
      primary_identifier: find_sec_bugs.INSECURE_COOKIE-1
      secondary_identifiers:
        - name: Find Security Bugs-INSECURE_COOKIE
          type: find_sec_bugs_type
          value: INSECURE_COOKIE
      license: MIT