Now Hacked
JA

今日のセキュリティ問題 #9

2026-11-09 の問題です。 コードを読んで、最も深刻なセキュリティ脆弱性を選んでください。

ふつうJavaScript (Node.js)2026-11-09

ユーザー設定をデフォルト値とマージする関数です。body はリクエストの JSON です。最も深刻な脆弱性はどれですか?

function merge(target, source) {
  for (const key in source) {
    if (typeof source[key] === 'object' && source[key] !== null) {
      target[key] = merge(target[key] ?? {}, source[key]);
    } else {
      target[key] = source[key];
    }
  }
  return target;
}
 
const settings = merge({}, req.body);

過去の問題