Skip to Content
ハンズオンJavaScript
book

ハンズオンJavaScript

by あんどうやすし
November 2020
Intermediate to advanced
740 pages
9h 12m
Japanese
O'Reilly Japan, Inc.
Content preview from ハンズオンJavaScript

18章セキュリティを学ぶ

これまでブラウザ上でJavaScriptを使用して実現できるさまざまな機能を紹介してきました。ネットワークアクセスやマルチメディアの利用のみならず、ハードウェアへのアクセスまでがJavaScriptを通じて実行できます。これは非常にすばらしいことですが、よく考えてみると、同時に非常に危険なことです。ブラウザ上でJavaScriptを動かすということは、作成者も動作の詳細も不明なプログラムをダウンロードして確認もなしに実行することを意味します。しかも動作環境であるブラウザにはSNSどころかネットバンキングのアカウント情報などの非常に重要な情報が大量に保存されているのです。しかし、それにもかかわらずJavaScriptが原因で何か致命的な問題が起きたという話は、ないとは言わないまでも、それほど頻繁には聞かれません。これはどうしてなのでしょう?

18.1 サンドボックス

JavaScriptが安全に利用できる最も大きな理由は、サンドボックスで動作するからです。サンドボックス(sandbox)は日本語で言うと砂場のことです。砂場の中では子供たちは自由にしかも安全に遊ぶことができ、砂場でどんなことをしたとしてもその枠の外側には影響を与えません。セキュリティ機構としてのサンドボックスも同様にプログラムの使用できるリソース、つまりアクセスできるファイルや実行できるプログラムを限定する代わりに、その制限の内側である限りは自由な利用を許可します。JavaScriptのサンドボックスによる代表的な制約には次のようなものがあります(ただし、これらの制限の中にはユーザーが明示的に許可を与えることで解除できるものもあります)。

  • 同一オリジンポリシー(same origin policy) ...
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

アルゴリズムクイックリファレンス 第2版

アルゴリズムクイックリファレンス 第2版

George T. Heineman, Gary Pollice, Stanley Selkow, 黒川 利明, 黒川 洋
Python機械学習クックブック

Python機械学習クックブック

Chris Albon, 中田 秀基
オブザーバビリティ・エンジニアリング

オブザーバビリティ・エンジニアリング

Charity Majors, Liz Fong-Jones, George Miranda, 大谷 和紀, 山口 能迪
プログラミングRust 第2版

プログラミングRust 第2版

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall, 中田 秀基

Publisher Resources

ISBN: 9784873119229Other