id: composer-config

info:
  name: Composer Config - Detect
  author: Mahendra Purbia (Mah3Sec_)
  severity: info
  description: Composer configuration file detected.
  reference: https://getcomposer.org/
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
    cvss-score: 0
    cwe-id: CWE-200
  metadata:
    max-request: 4
  tags: config,exposure

http:
  - method: GET
    path:
      - "{{BaseURL}}/composer.json"
      - "{{BaseURL}}/composer.lock"
      - "{{BaseURL}}/.composer/composer.json"
      - "{{BaseURL}}/vendor/composer/installed.json"

    matchers:
      - type: dsl
        name: composer.lock
        dsl:
          - "contains(body, 'packages') && contains(tolower(header), 'application/octet-stream') && status_code == 200"

      - type: dsl
        name: composer.json
        dsl:
          - "contains(body, 'require') && contains(tolower(header), 'application/json') && status_code == 200"
# digest: 4a0a00473045022100d07bcc8980b6294418c556f7137a30c51eac92c2e3cf8b5f21655114817c4e64022043faefa691f12bdb883c0edfea855250686a4986faae7a3bfbe1befbbb8e5b9c:922c64590222798bb761d5b6d8e72950