| タイトル | UnJS Teamのdefuにおけるオブジェクトプロトタイプ属性の不適切に制御された変更に関する脆弱性 |
|---|---|
| 概要 | defuは再帰的にデフォルトプロパティを割り当てることを可能にするソフトウェアです。バージョン6.1.5以前では、サニタイズされていないユーザー入力(例:解析されたJSONリクエストボディ、データベースレコード、信頼されていないソースからの設定ファイル)を`defu()`の最初の引数として渡すアプリケーションにプロトタイプ汚染の脆弱性が存在します。`__proto__`キーを含む細工されたペイロードにより、マージされた結果が意図されたデフォルト値を上書きされる可能性があります。内部の`_defu`関数は、`Object.assign({}, defaults)`を使ってdefaultsオブジェクトをコピーしていました。`Object.assign`は`__proto__`セッターを呼び出し、結果のオブジェクトの`[[Prototype]]`を攻撃者制御の値に置き換えます。汚染されたプロトタイプから継承されたプロパティは、その後`for...in`ループ内の既存の`__proto__`キーガードを回避し、最終結果に含まれます。バージョン6.1.5では、`Object.assign({}, defaults)`をオブジェクトスプレッド構文(`{...defaults}`)に置き換えています。これにより、`[[DefineOwnProperty]]`が使用され、`__proto__`セッターは呼び出されません。 |
| 想定される影響 | 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアは停止しません。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 |
| 対策 | 正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。 |
| 公表日 | 2026年4月6日0:00 |
| 登録日 | 2026年4月30日12:13 |
| 最終更新日 | 2026年4月30日12:13 |
| CVSS3.0 : 重要 | |
| スコア | 7.5 |
|---|---|
| ベクター | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| UnJS Team |
| defu 6.1.5 未満 |
| No | 変更内容 | 変更日 |
|---|---|---|
| 1 | [2026年04月30日] 掲載 |
2026年4月30日12:13 |
| 概要 | defu is software that allows uers to assign default properties recursively. Prior to version 6.1.5, applications that pass unsanitized user input (e.g. parsed JSON request bodies, database records, or config files from untrusted sources) as the first argument to `defu()` are vulnerable to prototype pollution. A crafted payload containing a `__proto__` key can override intended default values in the merged resul. The internal `_defu` function used `Object.assign({}, defaults)` to copy the defaults object. `Object.assign` invokes the `__proto__` setter, which replaces the resulting object's `[[Prototype]]` with attacker-controlled values. Properties inherited from the polluted prototype then bypass the existing `__proto__` key guard in the `for...in` loop and land in the final result. Version 6.1.5 replaces `Object.assign({}, defaults)` with object spread (`{ ...defaults }`), which uses `[[DefineOwnProperty]]` and does not invoke the `__proto__` setter. |
|---|---|
| 公表日 | 2026年4月7日3:16 |
| 登録日 | 2026年4月15日11:27 |
| 最終更新日 | 2026年4月7日22:20 |