目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1310

100%

CVE-2023-27372 PoC — SPIP 安全漏洞

来源
关联漏洞
标题:SPIP 安全漏洞 (CVE-2023-27372)
Description:SPIP是SPIP的一个用于创建 Internet 站点的免费软件。 SPIP 4.2.1之前版本存在安全漏洞,该漏洞源于序列化处理不当,攻击者利用该漏洞可以远程执行代码。
Description
This is a PoC for CVE-2023-27372 and spawns a fully interactive shell.
介绍

### This is a proof of concept CVE-2023-27372 SPIP RCE vulnerability.

It's a deserilzation flaw which exploits the dangerous use of #ENV tag during the reset password feature `(spip.php?page=spip_pass)` within `/ecrire/balise/formulaire_.php` Specifically this line:

1. Syntax: python3 exploit.py -u http(s)://url.com

```php
function protege_champ($texte){

	if (is_array($texte))

		$texte = array_map('protege_champ',$texte);

	else {

		// ne pas corrompre une valeur serialize

		if (preg_match(",^[abis]:\d+[:;],", $texte) AND unserialize($texte)!=false)

			return $texte;

		$texte = entites_html($texte);

		$texte = str_replace("'","'",$texte);

	}

	return $texte;

}
```

The `protege_champ` function suffers from various flaws. The regular expression (RE) check used to validate the input is flawed and can be bypassed easily. The code calls the `unserialize()` function without proper validation, allowing the execution of arbitrary code. Manual exploitation can be performed extremely easily. For example, if we wanted to execute `phpinfo();` we can do:

```php
oubli=s:19:"<?phpinfo(); ?>";
```
 If the server returns the expected out, it's vulnerable. How can we patch? Fairly simply actually. Below, I have wrote a basic patch:
```php
function protege_champ($texte) {

  if (is_array($texte)) {

    $texte = array_map('protege_champ', $texte);

  } else {

    if (!isValidInput($texte)) {

      $texte = 'Malicious input detected';

    } else {

      $texte = entites_html($texte);

      $texte = str_replace("'", "&#39;", $texte);

    }

  }

  return $texte;

}
```
The patched `protege_champ()` function includes input validation, sanitization, and handling of malicious input. 

<a href=https://twitter.com/redboltsec>Twitter</a>
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →