diff --git a/docs/labs/deserialization.js b/docs/labs/deserialization.js index 08d0bf62..d38f3399 100644 --- a/docs/labs/deserialization.js +++ b/docs/labs/deserialization.js @@ -37,29 +37,35 @@ info = { absent: "^ const data =\n", text: "The first section should begin with `const data =`", + text_ja: "最初のセクションは、`const data =`で始めなければなりません。", }, { present: "json", text: "the JSON built-in global object is witten in uppercase.", + text_ja: "JSONというビルトインのグローバルオブジェクトは全て大文字で書かれます", }, { absent: String.raw`JSON \. parse `, text: "Make a call to `JSON.parse` with the data retrieved, e.g., `JSON.parse(base64Decoded)` should be stored in `data`.", + text_ja: "取得したデータに対して`JSON.parse`を呼んでください。例: `JSON.parse(base64Decoded)`は`data`に格納されなければなりません", }, { present: String.raw`\+ `, text: "You should not have any concatenation (`+`) in the first section.", + text_ja: "最初のセクションでは、文字列連結(`+`)を用いるべきではありません。", }, { absent: "; $\n", text: "JavaScript does not require semicolons at the end of a statement, but since the other statements terminate with semicolons, you should also terminate your statement with a semicolon to be consistent.", + text_ja: "JavaScriptではステートメントの最後にセミコロンは必須ではありませんが、他のステートメントはセミコロンで終わっているため、一貫性を保つためにセミコロンでステートメントを終わらせなければなりません。", }, { absent: String.raw`^ if \(`, index: 1, text: "The second section should start with `if (` followed by a condition.", + text_ja: "二番目のセクションは、`if (`で始めてその次に条件を書かなくてはなりません。", examples: [ [ "const data = JSON.parse(base64Decoded);", @@ -72,33 +78,39 @@ info = `, index: 1, text: "Check if the data object has a property called username. You can do this by referencing data.username.", + text_ja: "データオブジェクトがusernameというプロパティを持っているかをチェックしてください。これは、data.usernameを参照することによって行うことができます。", }, { absent: String.raw`\&\&`, index: 1, text: "To combine multiple conditions in JavaScript use &&. This operator means 'and', so both conditions must be true for the entire statement to pass.", + text_ja: "JavaScriptで複数の条件を結合するには&&を用います。この演算子は「かつ」(AND)を意味し、ステートメント全体をパスするためには両方の条件が真でなければなりません。", }, { absent: "typeof", index: 1, text: "Use typeof to check the type of the operand's value. You should have `typeof data.username == 'string'` or similar.", + text_ja: "typeofを用いてオペランドの値の型をチェックしてください。`typeof data.username == 'string'`のようになるはずです。", }, { present: String.raw`typeof data \. username == 'String' `, index: 1, text: "When using typeof, JavaScript expects \"string\" all lowercase.", + text_ja: "JavaScriptでtypeofを使う際には、\"string\"を全て小文字で表記します。", }, { absent: "length", index: 1, text: "check if the length of the string is smaller than 20 characters. Use the expression `data.username.length < 20` to determine this.", + text_ja: "文字列の長さが20文字より小さいことをチェックしてください。`data.username.length < 20`というエクスプレッションを使って判断してください。", }, { present: String.raw`^ if \(`, absent: String.raw`^ if \( data \. username &&`, index: 1, text: "Begin the second section with `if ( data.username && ... ` because you must check if data is even present before you can check various attributes of that data.", + text_ja: "二番目のセクションを`if ( data.username && ... `で始めてください。これは、データのいろいろなアトリビュートをチェックする前に、それがそもそも存在するかをチェックしなければならないからです。", examples: [ [ "const data = JSON.parse(base64Decoded);", diff --git a/docs/labs/ja_deserialization.html b/docs/labs/ja_deserialization.html new file mode 100644 index 00000000..8709064e --- /dev/null +++ b/docs/labs/ja_deserialization.html @@ -0,0 +1,114 @@ + + +
+ + + + + + + + + + + + + + ++これはセキュアなソフトウェア開発に関するラボ演習です。 +ラボの詳細については、概要をご覧ください。 + +
+
+下記のコードを変更して、安全でないデシリアライゼーション(Insecure Deserialization)の脆弱性を防止するようにしてください。 + +
+
+安全でないデシリアライゼーションは、アプリケーションのデシリアライゼーションのプロセスが悪用されて起こり、攻撃者がシリアライズされたデータを改変してアプリケーションコードに悪影響を及ぶデータを渡すことができてしまうものです。 +
+この脆弱性を防ぐ最も安全な方法は、信頼できないソース(ユーザーがコントロールできるデータ)からシリアライズされたオブジェクトを受け入れないようにすることです。しかし、もし受け入れる必要があるときには、実装することのできる緩和策がいくつかあります。このラボでは、そのような緩和策をいくつか適用します。 + +
+
+ +
+下記のコードは、アプリケーションのログインページの後に呼ばれます。ログイン後、ユーザーのプロファイルを含むクッキーが作られ、ホームページでクッキーはデシリアライズされ、その中のユーザー名(username)を挨拶のメッセージで使います。 +
+このコードをよりよく見ると、クッキーからデータをデシリアライズする際にeval()を用いていることがわかります。これは非常に危険となりうるもので、eval()は文字列をJavaScriptのコードとして評価するために、文字列に含まれる任意のコードが実行されることとなり、リモートコード攻撃(RCE)やコードインジェクション攻撃の可能性を開くものです。 +
+このラボでは、攻撃者がコードを実行することを防ぐアプローチを用いてこれを修正します。また、簡単な入力のバリデーションを行うことで、JSONデータから得られるものが期待通りものであることを確認します。 +
+必要に応じて、「ヒント」ボタンと「諦める」ボタンを使用してください。 + +
+
+
+ +下記のコードを変更して、安全でないデシリアライゼーションを防ぐ緩和策を追加してください。 +