שמירה על אפליקציות
הוצג| English | משמעות |
|---|---|
| secure by design/sɪˈkjʊə baɪ dɪˈzaɪn/ | בטוח בעיצוב |
| secure by default/sɪˈkjʊə baɪ dɪˈfɒlt/ | בטוח כברירת מחדל |
| input sanitization/ˈɪnpʊt ˌsænɪtaɪˈzeɪʃn/ | ניקוי קלט |
| special characters/ˈspeʃl ˈkærɪktəz/ | מקראות מיוחדים |
| control characters/kənˈtrəʊl ˈkærɪktəz/ | תוויות בקרה |
| parameterised queries/ˌpærəˈmetəraɪzd ˈkwɪərɪz/ | שאלות פראמטריזציה |
Secure by design and default
- Secure by design 安全设计 builds security into every phase of development, including how untrusted data reaches a database, browser or file system.
- Secure by default 默认安全 enables protective settings from the start. It reduces risk; it does not guarantee that a product has no vulnerabilities.
Keep input as data
- Input sanitization 输入清理 transforms input for a specific purpose; validation checks an allowed type, length, range or format. Neither is a universal attack filter.
- Quotes and semicolons are ordinary printable special characters 特殊字符, not necessarily control characters. A legitimate name such as
O'Neillshould not be damaged just because it contains an apostrophe.
בחר את הבקרה ליעד
הפרד ערכי SQL מסינטקס, הגן על תוכן הדפדפן עבור ההקשר שלו, וצמצם קטעי מסלול שפותרו; אין סינון פונקציות רגילות אוניברסלי.
"בטוחברירת מחדל" פירושו שמוצר מגיע עם...
Difficulty 1/5 · 100 coins + a small bonus on first completion today
ברירת מחדל בטוחה מאפשרת הגנות מהתחילה; היא אינה מבטיחה מערכת חסרת חריגות.
שדה מספרי ב-SQL מקבל 0 או 1=1. איזה בקרה מונעת שהקלט הזה יהפוך לסנטקס של שאילתה?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
הקלט אינו זקוק לתוויות ציטוט או נקודה-פסיק. הצמדת פרמטרים שומרת אותו כנתונים; יש also לאמת את הטווח המספרי גם כן. קידוד HTML מיועד למטרה אחרת.
שמור על ערכים נפרדים מסינטקס ה-SQL באמצעות שאילתות ____.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
הצמד כל ערך בנפרד במקום לחבר אותו לטקסט של SQL.
אילו הצהרות משתמשות בבקרים המותאמים ליעד? סמן את כולם שחל עליהם.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
השלושה בקרים הראשונים מתאימים ליעדיהם. רשימת איסור על סימני הוצאה עלולה לפגוע בשמות חוקיים ואינה מגנה על כל שלושת ההקשרים.
Match the control to the destination
- For SQL injection, use parameterised queries 参数化查询: fixed SQL structure and separately bound data values. Validation adds a check but does not replace binding.
- For XSS, render plain text with a safe text API or apply output encoding for the actual HTML, attribute or other context. If HTML is allowed, use a suitable HTML sanitizer.
- For directory traversal, resolve the requested path and require it to remain inside the permitted directory. Rejecting quote characters does not establish that boundary.
A single character blacklist cannot protect every destination. An age field can be abused with 0 OR 1=1, which needs no quotes or semicolon. The right defense keeps input out of the query's syntax. Validation must also check whether the age is a valid number in the allowed range.
עיצוב בטוח בונה אבטחה משלב פיתוח מוקדם מאוד.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
האבטחה היא עיקרון עיצוב, ולא תוספת.
A pupil search should accept the exact name O'Neill. Write a fixed query such as SELECT name FROM pupils WHERE name = ? and bind the entered name separately. An input such as ' OR '1'='1 then remains one name value rather than changing the query. When displaying a name, insert it as text; do not assemble executable HTML from it. This preserves legitimate input while protecting both destinations with their own controls.
Build security into the design and enable safe defaults. Validate input for the task, keep SQL values separate from SQL syntax, encode or safely render browser output, and enforce file-system boundaries. Do not claim that stripping punctuation stops every input attack.