Ozgur Sar -
29 June 2022 -
Cyber Solutions Vendor -
#cybersecurity
web
security
common threats
-
896 views -
0 Comments -
0 Likes -
0 Reviews
INTRODUCTION
You should understand that a web application cannot trust any data from the web browser.All user-originating data should be sanitized before it is displayed, or used in SQL queries and file system calls.
This includes, but is not limited to data in URL parameters of GET
requests, POST
requests, HTTP headers and cookies, and user-uploaded files. Always check and sanitize all incoming data. Always assume the worst.
Important points to take into consideration:
Effective password management and using two-factor authentication.
Using HTTPS to encrypt data sent between your client and server.
Keeping track of the most popular threats and periodically testing for vulnerabilities.
Only storing and displaying data that you need.
This article won't make you a website security guru, but it will help you understand where threats come from, and what you can do to harden your web application against the most common attacks.
Let's dive into details of web security.
The Purpose of Web Security?
The purpose of website security is to prevent any sorts of attacks. The more formal definition of website security is the act/practice of protecting websites from unauthorized access, use, modification, destruction, or disruption.
Effective website security requires design effort across the whole of the website: in your web application, the configuration of the web server, your policies for creating and renewing passwords, and the client-side code.
Cross-site Scripting (XSS)
The most common web security threat is XSS. XSS is a term used to describe a class of attacks that allow an attacker to inject client-side scripts through the website into the browsers of other users. Because the injected code comes to the browser from the site, the code is trusted and can do things like send the user's site authorization cookie to the attacker.
When the attacker has the cookie, they can log into a site as though they were the user and do anything the user can, such as access their credit card details, see contact details, or change passwords.
The best defense against XSS vulnerabilities is to remove or disable any markup that can potentially contain instructions to run the code. For HTML this includes elements, such as <script>
, <object>
, <embed>
, and <link>
.
SQL Injection
SQL injection vulnerabilities enable malicious users to execute arbitrary SQL code on a database, allowing data to be accessed, modified, or deleted irrespective of the user's permissions.
A successful injection attack might spoof identities, create new identities with administration rights, access all data on the server, or destroy/modify the data to make it unusable.
This vulnerability is present if user input that is passed to an underlying SQL statement can change the meaning of the statement.
To avoid this sort of attack, you must ensure that any user data that is passed to an SQL query cannot change the nature of the query. One way to do this is to escape all the characters in the user input that have a special meaning in SQL.
Cross-site Request Forgery (CSRF)
CSRF attacks allow a malicious user to execute actions using the credentials of another user without that user's knowledge or consent.
If a user clicks the submit button, an HTTP POST
request will be sent to the server containing the transaction details and any client-side cookies that the browser associated with the site (adding associated site cookies to requests is normal browser behavior). The server will check the cookies, and use them to determine whether or not the user is logged in and has permission to make the transaction.
One way to prevent this type of attack is for the server to require that POST
requests include a user-specific site-generated secret. The secret would be supplied by the server when sending the web form used to make transfers.
FURTHER READING
For a comprehensive listing of website security threats visit Web security exploits
Copyright © 2025