id: yarn-lock

info:
  name: Yarn Lock File Disclosure
  author: oppsec,noraj
  severity: info
  description: |
    The yarn.lock file stores the versions of each Yarn dependency installed. It's a lock file for package.json.
  reference:
    - https://classic.yarnpkg.com/lang/en/docs/yarn-lock/
  metadata:
    max-request: 1
  tags: exposure,files,yarn,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/yarn.lock"

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY."
          - "# yarn lockfile v1"
        condition: and

      - type: word
        part: header
        words:
          - "text/html"

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