Skip to Content
ウェブアプリケーションセキュリティ 第2版
book

ウェブアプリケーションセキュリティ 第2版

by Andrew Hoffman
March 2025
Intermediate to advanced
444 pages
6h 9m
Japanese
O'Reilly Media, Inc.
Audio summary available
Content preview from ウェブアプリケーションセキュリティ 第2版

第15章. データとオブジェクトを攻撃する

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

現代のプログラミング言語の大部分 は、2つの異なる機能を利用した論理的なプログラム設計を実装している。それは、一般的にオブジェクトの形で表現されるデータと関数の形で表現されることの多いアクションである。オブジェクト指向プログラミング(OOP)ではないプログラミング言語でも、オブジェクトは第一級市民として定義されている。

第一級市民という用語は、プログラミング言語の設計概念で、代入、再代入、変更、関数の引数として渡すこと、関数から返すことができるプログラミング言語内のエンティティを指す。ほぼすべての現代プログラミング言語がオブジェクト(データ)を第一級市民として定義しているが、すべての現代言語が関数(アクション)を第一級市民として定義しているわけではない。そのため、現代のほとんどのプログラミング言語は、データを格納する役割とデータを演算する役割を2つの異なる言語機能に分割していると言える。

この章では、データがオブジェクトの形で格納され、関数を通じて操作されている間にデータを悪用するメソッドについて述べる。これらのテクニックは多くの最新のプログラミング言語に対して機能し、データを第一級市民としてストアすることによる強力な副作用を悪用する。

大量代入

第一級オブジェクトを攻撃する最も一般的な方法は、大量代入攻撃である。通常、標準化された現代的な用語である代入攻撃(mass assignment attack)または代入脆弱性(mass assignment vulnerability)を使って呼ばれるが、歴史的な攻撃では、 自動バインディング攻撃(Spring MVCとASP.NETフレームワークの場合)、 オブジェクトインジェクション攻撃(レガシーPHPの脆弱性の場合)という用語も使われていた。これらの用語はすべて、同じ搾取の仕組みを指している。

大量代入の脆弱性は、キーの検証を行わない関数呼び出しにオブジェクト内の追加フィールドを渡すことで、攻撃者が意図していないフィールドを変更することを可能にする。混乱しそうだが、このセクションの例を見直せば、発見するのは非常に簡単になる。

大量代入の脆弱性は、通常、ある関数から別の関数へ、(オブジェクトの形で)多くの状態関連データを受け渡すシステム内で発見される。大量代入に対して脆弱である可能性のあるアプリケーションのタイプの1つの良い例は、定期的にユーザの状態情報を受け渡すビデオゲームである。脆弱性があるかもしれないもう一つのタイプのアプリケーションは、"ダイナミック・フォーム"、すなわちエンドユーザによってそのタイトルやデータ型などが変更される可能性のあるフォームを実装しているウェブ・アプリケーションです。これらのアプリケーションは、アプリケーションセキュリティを考慮してプログラミングされていなければ、大量代 入によって攻撃される可能性が高い。

大量代入の脆弱性の一般的な形式を説明する、以下のコード・スニペットを少し評価してみよう:

/*
 * This is a server-side API endpoint for updating player data
 * for the web-based video game "MegaGame".
*/
app.post("updatePlayerData", function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

ハイパーモダンPython ―信頼性の高いワークフローを構築するモダンテクニック

ハイパーモダンPython ―信頼性の高いワークフローを構築するモダンテクニック

Claudio Jolowicz, 嶋田 健志, 鈴木 駿
Kubernetesで実践するクラウドネイティブDevOps

Kubernetesで実践するクラウドネイティブDevOps

John Arundel, Justin Domingus, 須田 一輝, 渡邉 了介
流暢なReact

流暢なReact

Tejas Kumar

Publisher Resources

ISBN: 9798341627505