Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Incomplete naming schema and API usage patterns in py/insecure-cookie

Đang mở
#21,647 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
security

Hướng nghiên cứu

Bắt đầu từ rule py/insecure-cookie và kiểm tra predicate cookie.isSensitive cùng cách xử lý set_cookie được mô tả trong issue. So sánh các tên token được liệt kê và các ví dụ Set-Cookie trực tiếp với hành vi hiện tại; công việc được hoàn tất khi các mẫu cookie xác thực được hỗ trợ được phát hiện mà không chỉ dựa vào các phương thức của framework.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

  1. The existing cookie.isSensitive predicate seems to miss common modern authentication token patterns. I have found some and listed them below.
  2. The rule currently relies primarily on specific framework methods (e.g., set_cookie). It ignores direct HTTP manipulation, which is also very common.

code example:

from flask import Flask, Response, make_response

app = Flask(__name__)

@app.route("/login")
def login():
    resp = make_response("Logged in")
    resp.set_cookie("authKey", "secret123") # $ Alert[py/insecure-cookie]
    resp.set_cookie("accessToken", "secret123") # $ missing
    resp.set_cookie("access_token", "secret123") # missing
    resp.set_cookie("auth_token", "secret123") # missing
    resp.set_cookie("jwt", "secret123") # $ missing
    resp.set_cookie("oauth_token", "secret123") # $ missing


    # cannot support this
    resp.headers.add("Set-Cookie", "authKey=secret123") # missing

    # This is also common, but it seems more difficult to support this.
    from http.cookies import SimpleCookie
    resp = make_response("Logged in")
    cookie = SimpleCookie()
    cookie["session"]['authKey'] = "secret123" # missing
    # cookie["session"]["httponly"] = True
    # cookie["session"]["secure"] = True
    for key, morsel in cookie.items():
        resp.headers.add('Set-Cookie', morsel.OutputString())
    return resp
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
143

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/codeql

Tất cả issue của github/codeql

Issue tương tự

Thêm issue về Security

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.