NYCU-LYX

11-Software Security

11.1  Software Security Issues

Introducing Software Security and Defensive Programming

Software Error Categories

Software Security: Software Quality/Reliability?

Defensive or Secure Programming

Security by Design

11.2  Handling Program Input

Input Size and Buffer Overflow

Interpretation of Program Input

Injection Attacks

SQL Injection Example

Vulnerable PHP code

Vulnerable PHP code

Cross-site Scripting (XSS) Attacks

XSS Reflection

Validating Input Syntax

Validating Numeric Input

Input Fuzzing

11.3  Writing Safe Program Code

Correct Algorithm Implementation

Ensuring that Machine Language Corresponds to Algorithm

Correct Interpretation of Data Values

Correct Use of Memory

正確解釋數據值的意義

這段講述了電腦中數據存儲和解釋的方式,以及一些潛在的錯誤風險。

重點:

解釋轉換的風險:

記憶體管理的錯誤:

C 語言和記憶體管理:

現代語言的記憶體管理:

Preventing Race Conditions with Shared Memory

11.4  Interacting with the Operating System and Other Programs

Environment Variables

Using Appropriate, Least Privileges

Systems Calls and Standard Library Functions

Example: How to Securely Delete a File?

Preventing Race Conditions with Shared System Resources

Safe Temporary File Use

Interacting with Other Programs

11.5  Handling Program Output

11.6  Key Terms, Review Questions, and Problems

#