This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "OWASP Secure Application Design Project"
From OWASP
Ashish Rao (talk | contribs) (→Design Flaws - Web) |
Ashish Rao (talk | contribs) |
||
Line 172: | Line 172: | ||
==Business Logic Invocation Technique== | ==Business Logic Invocation Technique== | ||
− | ''Introduction'' | + | '''Introduction''' |
In most of the design techniques the request parameters or the URL’s serve as sole factors to determine the processing logic. In such a scenario the elements in the request which are used for such identifications may be subject to manipulation attacks to obtain access to restricted resources or pages in the application. | In most of the design techniques the request parameters or the URL’s serve as sole factors to determine the processing logic. In such a scenario the elements in the request which are used for such identifications may be subject to manipulation attacks to obtain access to restricted resources or pages in the application. | ||
Line 179: | Line 179: | ||
<img1> | <img1> | ||
− | ''What is the flaw?'' | + | '''What is the flaw?''' |
A flaw in such a design could be that unused configurations may be present in the configuration file that can be accessed by an attacker. Such configurations that are not exposed as valid features in the application and could serve as a potential backdoor to it. | A flaw in such a design could be that unused configurations may be present in the configuration file that can be accessed by an attacker. Such configurations that are not exposed as valid features in the application and could serve as a potential backdoor to it. | ||
Line 186: | Line 186: | ||
Observe that the “TestAction” has an insecure logic to delete records from the system. This can act as a potential backdoor to the application. | Observe that the “TestAction” has an insecure logic to delete records from the system. This can act as a potential backdoor to the application. | ||
− | ''Consider another scenario - Method Invocation'' | + | '''Consider another scenario - Method Invocation''' |
In the some designs request parameters are used to identify business logic methods. In the figure shown below a request parameter named “event” is used to identify and invoke the corresponding event handling methods of the business logic/action class. | In the some designs request parameters are used to identify business logic methods. In the figure shown below a request parameter named “event” is used to identify and invoke the corresponding event handling methods of the business logic/action class. | ||
− | ''What is the flaw?'' | + | '''What is the flaw?''' |
Here, the user can attempt to invoke the methods of the events that are not visible to the user. | Here, the user can attempt to invoke the methods of the events that are not visible to the user. | ||
Line 197: | Line 197: | ||
• Maintain a mapping of method/class/view names with the privilege level of the users, wherever applicable and restrict access of the users to restricted URLs/methods/views. | • Maintain a mapping of method/class/view names with the privilege level of the users, wherever applicable and restrict access of the users to restricted URLs/methods/views. | ||
− | ''Review Criteria'' | + | '''Review Criteria''' |
With a view of the above mentioned factors we must carefully evaluate the design of any application to determine whether user inputs are directly (i.e. without any restriction) used to determine any of the following elements (as applicable): | With a view of the above mentioned factors we must carefully evaluate the design of any application to determine whether user inputs are directly (i.e. without any restriction) used to determine any of the following elements (as applicable): | ||
Line 291: | Line 291: | ||
During testing it is crucial to identify the key parameters related to business logic and understand how application handles them. This section will focus on insecure business logic decisions that are based on such parameters. There are 3 such cases listed below: | During testing it is crucial to identify the key parameters related to business logic and understand how application handles them. This section will focus on insecure business logic decisions that are based on such parameters. There are 3 such cases listed below: | ||
− | ''CASE 1:'' The application must not depend on non-editable controls, drop-down menus or hidden fields for business logic processing. It is a secure practice to use the business logic parameters like price, max limit etc. from the server side. Even if the application sends these parameters as non-editable, select or hidden parameters it must maintain a separate copy of such values at the server side and use the same for business logic processing. | + | '''CASE 1:''' The application must not depend on non-editable controls, drop-down menus or hidden fields for business logic processing. It is a secure practice to use the business logic parameters like price, max limit etc. from the server side. Even if the application sends these parameters as non-editable, select or hidden parameters it must maintain a separate copy of such values at the server side and use the same for business logic processing. |
The users can easily alter such parameter values and try to manipulate business logic. | The users can easily alter such parameter values and try to manipulate business logic. | ||
− | ''CASE 2:'' At times applications tend to make logical decisions merely on the basis of the values of certain request parameters. Such parameters are often the once indicating the type of the user, nature of the request, status of the transaction, etc. The application must not expose such parameters to the users. Even if they are exposed, the application must not rely on request parameters for logical decisions and analyse the same from server side processing. | + | '''CASE 2:''' At times applications tend to make logical decisions merely on the basis of the values of certain request parameters. Such parameters are often the once indicating the type of the user, nature of the request, status of the transaction, etc. The application must not expose such parameters to the users. Even if they are exposed, the application must not rely on request parameters for logical decisions and analyse the same from server side processing. |
The users can easily manipulate such parameter values and try to evade business logic validations or elevate privileges in the application. | The users can easily manipulate such parameter values and try to evade business logic validations or elevate privileges in the application. | ||
− | ''CASE 3:'' Some application developers believe in the concept of – “what is hidden is secure”. They decide on the visibility of the some input fields for the features based on the role/privilege level of the logged-in user. This is especially observed in ASP.NET applications where there is provision to make the server side controls hidden/invisible for certain users. However, in most cases it has been observed that if the users add the parameters corresponding to the UI elements that are kept hidden/invisible to them into the request, they are able to change the behaviour of the server side logic. | + | '''CASE 3:''' Some application developers believe in the concept of – “what is hidden is secure”. They decide on the visibility of the some input fields for the features based on the role/privilege level of the logged-in user. This is especially observed in ASP.NET applications where there is provision to make the server side controls hidden/invisible for certain users. However, in most cases it has been observed that if the users add the parameters corresponding to the UI elements that are kept hidden/invisible to them into the request, they are able to change the behaviour of the server side logic. |
Consider a scenario where only admin user can change password of other users of the system, as a result the field to enter username is only made visible to the admin user. However, if a normal a user tries to add username parameter in the request he/she will be able to trick the server in believing that the request has come from an admin user and try to change password of other users. Thus there exists a loophole in such applications where the server side behaviour can be influenced with request parameters. Users can perform unauthorized operations in the application by supplying the values for the inputs fields that are hidden from them. | Consider a scenario where only admin user can change password of other users of the system, as a result the field to enter username is only made visible to the admin user. However, if a normal a user tries to add username parameter in the request he/she will be able to trick the server in believing that the request has come from an admin user and try to change password of other users. Thus there exists a loophole in such applications where the server side behaviour can be influenced with request parameters. Users can perform unauthorized operations in the application by supplying the values for the inputs fields that are hidden from them. | ||
Revision as of 18:05, 9 June 2015