test : add unit tests for _escape_like SQL injection guard

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

@aaniya22 đang làm issue này rồi.

Từ ngày 3/8/2026.

  • #2311 của @tmdeveloper007 — đã đóng, không merge
  • #2438 của @aaniya22 — đã đóng, không merge

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Summary of What Needs to be Done:
Add unit tests for the _escape_like function in backend/secuscan/routes.py. This function escapes SQLite LIKE wildcards (% and _) to prevent pattern injection via user search input.

Changes that Need to be Made:

  • Create testing/backend/unit/test_routes_escape_like.py
  • Test cases should cover:
    • Normal string passes through unchanged
    • Backslash is escaped to double backslash
    • Percent sign is escaped
    • Underscore is escaped
    • Multiple wildcards are all escaped
    • Empty string returns empty string
    • Mixed content with all wildcard types

Impact that it would Provide:

  • Prevents SQL LIKE pattern injection vulnerabilities in search functionality
  • Documents the escaping behavior
  • Ensures the security guard is correctly implemented

Note: This task is being handled by tmdeveloper007 — please assign to that account when picking it up.

Ngôn ngữ chính
Python
Star
36
Fork
234
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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 utksh1/SecuScan

Tất cả issue của utksh1/SecuScan

Issue tương tự

Thêm issue về Python

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.