Many Web applications are plagued by poor authentication and authorization mechanisms. This chapter mainly discusses the vulnerabilities related to these mechanisms and provides some methods to help you avoid common mistakes. I will illustrate these methods through some examples, but be careful not to separate these examples from their context. It is important to understand the principles and methods contained in them. You can use them correctly only at that time.
After verification, we can determine the identity of a user. A typical practice is to simply use the user name and password for the check. In this way, we can determine that the login user is an authorized user.
Identity Authentication, often called access control, is a method that you can use to protect access to restricted resources and to determine whether a user has the right to access specific resources. For example, many web applications have resources that are only open to authorized users, resources that are only open to system administrators, and resources that are open to all users.
One of the main causes of access control vulnerabilities is carelessness-this part of Web ApplicationsProgramIs least concerned and noticed. In development, management functions and access control are often the final consideration. In addition, management functions and access control are generally taken into account and written from the starting point of authorization, without the possible means that attackers may use. The trust in authorized users is far higher than that of anonymous users. However, if your management function is directly accessible through URLs, it will become the target of attackers. Negligence is your primary enemy.
For security purposes, access control needs to be comprehensively considered during design. It should not be a bolt for an existing application. Although this may happen sometimes, this process is very prone to errors, and access control errors will inevitably lead to security vulnerabilities.
Access control also requires a reliable identification mechanism. After all, if an attacker can pretend to be a legitimate user, all access control based on user identification is invalid. Therefore, you must consider the attack situation, such as session hijacking. For more information about the attack methods related to sessions, see Chapter 4.
This chapter describes four aspects that require attention in verification and authorization: brute force attacks, password sniffing, replay attacks, and permanent logon.