RFI and LFI
The most famous among the bug hunters and in bounty programs is RFI and LFI vulnerabilities. They both root from file inclusion vulnerabilities.
Simple one liner - When the file from a remote location is included, then its RFI(Remote file inclusion). If the file is from the local directory, then it is LFI(Local file inclusion)
In description:
Consider your web application is referencing a file in the form of a url to a remote location. This reference is trying to fetch a .png or .php or .js. When an attacker changes this file, the behaviour of the web application changes.
The impact of this can vary based on the file that got included. The least can be simply a change in the way a page looks. When the file included executes a piece of code is when the consequences get worse. The file can be malicious which escalates privileges of a certain user and performs an irreversible action.
File inclusions are easy to mitigate to a large extent using simple input validations and sanitising the inputs. The other measures include
Simple one liner - When the file from a remote location is included, then its RFI(Remote file inclusion). If the file is from the local directory, then it is LFI(Local file inclusion)
In description:
Consider your web application is referencing a file in the form of a url to a remote location. This reference is trying to fetch a .png or .php or .js. When an attacker changes this file, the behaviour of the web application changes.
The impact of this can vary based on the file that got included. The least can be simply a change in the way a page looks. When the file included executes a piece of code is when the consequences get worse. The file can be malicious which escalates privileges of a certain user and performs an irreversible action.
File inclusions are easy to mitigate to a large extent using simple input validations and sanitising the inputs. The other measures include
1. List the acceptable objects, such as filenames or URLs. Blacklist everything else.
2. For any check at the client side, make sure the same check or an extension of the same is done at the server side too as attackers will have ways to bypass checks at the client end
3. Always allow the code to run with the least privileges
4. Reduce the attack surface by analysing the attack entry points
5. When using the PHP for your applications, make sure they dont use register_globals.
Comments
Post a Comment