课程: Advanced Python: Build Hands-On Projects with Design Patterns (2023)

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Intercepting Validator pattern

Intercepting Validator pattern

- [Instructor] Many cybersecurity attacks exploit software system's dependence on user inputs. In fact, this is often the weakest link in our defense against cyber criminals. Some of the most famous hacking techniques include SQL injection and cross-site scripting. Both SQL injection and cross-site scripting take advantage of the absence of a mechanism to check user inputs before using them for further processing. In the case of SQL injection, malicious users append additional database commands to a user input, intended to be raw data like username, as shown here. Cross-site scripting attempts to execute a piece of code by entering it into a text field as you can see here. The key to preventing both SQL injection and cross-site scripting is adding a step in your code to validate if a user input contains any suspicious keywords. In our SQL injection example, the word or is highly suspicious because it's rare for…

内容