id: webpack-config

info:
  name: Webpack Configuration File - Detect
  author: ambassify,s4e-io
  severity: info
  description: Webpack configuration file was detected.
  reference:
    - https://webpack.js.org/configuration/
  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
    cpe: cpe:2.3:a:webpack.js:webpack:*:*:*:*:node.js:*:*:*
  metadata:
    max-request: 1
    shodan-query: html:"webpack.config.js"
    product: webpack
    vendor: webpack.js
  tags: config,exposure,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/webpack.config.js"

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "module.exports"
          - "const"
        condition: or

      - type: word
        part: header
        words:
          - "application/javascript"
          - "text/javascript"
        condition: or

      - type: word
        part: body
        words:
          - "<html"
          - "<!doctype"
        case-insensitive: true
        negative: true

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