← PHP / Laravel · 目次

PHP-094 / 上級

YAML ロード時の任意タグ解釈(旧ライブラリ)

A08:2021 Software and Data Integrity Failures · CWE-502 Deserialization of Untrusted Data

なぜ問題になるのか?

言語固有の拡張タグが任意クラスを生成する可能性があります。

修正方法

php
$cfg = json_decode($request->getContent(), true, 512, JSON_THROW_ON_ERROR);

参考資料