Web Security Vulnerabilities
Web Security Vulnerabilities
• Q&A
Web security
It basically means protecting a website or web application by detecting, preventing and
responding to cyber threats.
§ Websites and web applications are just as prone to security breaches at physical homes,
stores, and government locations
§ Great web security measures are needed to protect websites and web applications from
becoming compromised as cybercrime happens every day.
Website security is any action or application taken to ensure website data is not
exposed to cybercriminals or to prevent exploitation of websites in any way.
Website security protects your website from:
q DDoS attacks: These attacks can slow or crash your site entirely, making it
inaccessible to visitors.
q Malware: Short for “malicious software,” malware is a very common threat used to
steal sensitive customer data, distribute spam, allow cybercriminals to access your
site, and more.
q Blacklisting. Your site may be removed from search engine results and flagged with
a warning that turns visitors away if search engines find malware.
q Phishing schemes: Phishing doesn’t just happen in email – some attacks take the
form of web pages that look legitimate but are designed to trick the user into providing
sensitive information.
q Session hijacking: Some cyber attacks can take over a user’s session and force
them to take unwanted actions on a site.
q Malicious redirects: Certain attacks can redirect visitors from the site they intended to
visit to a malicious website.
q SEO Spam: Unusual links, pages, and comments can be put on a site to confuse your
visitors and drive traffic to malicious websites.
Securing Website
v An SSL certificate: SSL certificates protect the data collected by your website, like emails and
credit card numbers, as it is transferred from your site to a server.
v SSL only protects data in transit, so you’ll need to take further steps for a fully secure website.
v A web application firewall (WAF) :A WAF stops automated attacks that commonly target small or
lesser-known websites. These attacks are carried out by malicious bots that automatically look
for vulnerabilities they can exploit, or cause DDoS attacks that slow or crash your website.
v A website scanner :A website scanner looks for malware, vulnerabilities and other security
issues so that you can mitigate them appropriately. SiteLock’s scanners not only remove known
malware, they also look for threats on a daily basis and let you know the moment anything is found,
reducing the amount of damage it can do to your site.
v Software updates :vulnerabilities and security issues often found in third-party plugins and
applications. These can be prevented by installing updates to plugins and core software in a timely
manner, as these updates often contain security patches – you can even use an automatic patching
solution to make it easier.
Web Application Security
Ø The global nature of the Internet exposes web properties to attack from different
locations and various levels of scale and complexity.
Ø There are a lot of factors that go into web security and web protection. Any website
or application that is secure is surely backed by different types of checkpoints and
techniques for keeping it safe.
Ø Web application security deals specifically with the security surrounding websites,
web applications and web services such as APIs
Ø There are a variety of security standards that must be followed at all times, and
these standards are implemented and highlighted by the OWASP
Ø Most experienced web developers from top cyber security companies will follow
the standards of the OWASP
Ø Web application security is a central component of any web-based business.
Essential Steps to Protect Web Apps from Attacks
v Up-to-date encryption
v Setting proper authentication
v Continuously patching discovered vulnerabilities
v Secure Software Development Process to avoid data theft
v Do not provide scope of flaws in environment to clever attackers.
Open Web Application Security Project (OWASP)
Ø Website: https://www.owasp.org
• Non profit organization
• open community
• Vulnerabilities
• Threats
• Attacks and countermeasures
• Development guide
• Testing guide
• Code review guide
• Webgoat sample web application
• Mailing lists
• Newsletter
• Many more…
Top 10 Vulnerabilities
1. SQL Injection
2. Broken Authentication and Session Management
3. Cross Site Scripting (XSS)
4. Broken access Control
5. Security Misconfiguration
6. Sensitive Data Exposure
7. Missing Function Level Access Control
8. Cross Site Request Forgery (CSRF)
Ø The statement 1 = 1 in the query is always true. It passes the access and
returns all of the product names and descriptions in the database to the attacker.
•The core of a code injection vulnerability is the lack of validation and sanitization of
the data used by the web application, which means that this vulnerability can be
present on almost any type of technology.
Types of SQL Injection (SQLi)
In-band SQLi (Classic SQLi)
In-band SQL Injection is the most common and easy-to-exploit of SQL Injection
attacks. In-band SQL Injection occurs when an attacker is able to use the same
communication channel to both launch the attack and gather results.
Inferential SQLi (Blind SQLi)
Inferential SQL Injection, unlike in-band SQLi, may take longer for an attacker to
exploit, however, it is just as dangerous as any other form of SQL Injection. In
an inferential SQLi attack, no data is actually transferred via the web application
and the attacker would not be able to see the result of an attack in-band
(commonly also referred to as “blind SQL Injection attacks”). Instead, an
attacker is able to reconstruct the database structure by sending payloads,
observing the web application’s response and the resulting behavior of the
database server.
Out-of-band SQLi
Out-of-band SQL Injection is not very common, mostly because it depends on
features being enabled on the database server being used by the web
application. Out-of-band SQL Injection occurs when an attacker is unable to
use the same channel to launch the attack and gather results.
Preventing Injection
• Avoid dynamic queries
• Parameterized queries
• PreparedStatement, SQLCommand, PHP Data Object (PDO)
• Stored procedures
• Input validation
• Carefully escape special characters if no api is available
• OWASP Enterprise Security API
• ESAPI.encoder().encodeForSQL(new OracleCodec(), queryparam);
Reflected XSS: where the malicious script comes from the current HTTP
request.
Stored XSS: where the malicious script comes from the website's database.
DOM-based XSS: where the vulnerability exists in client-side code rather than
server-side code.
Prevent XSS attacks
Preventing cross-site scripting is trivial in some cases but can be much harder
depending on the complexity of the application and the ways it handles user-
controllable data.
In general, effectively preventing XSS vulnerabilities is likely to involve a combination
of the following measures:
Filter input on arrival: At the point where user input is received, filter as strictly as
possible based on what is expected or valid input.
Encode data on output: At the point where user-controllable data is output in HTTP
responses, encode the output to prevent it from being interpreted as active content.
Depending on the output context, this might require applying combinations of HTML,
URL, JavaScript, and CSS encoding.
Use appropriate response headers: To prevent XSS in HTTP responses that aren't
intended to contain any HTML or JavaScript, you can use the Content-Type and X-
Content-Type-Options headers to ensure that browsers interpret the responses in the
way you intend.
Content Security Policy: As a last line of defense, you can use Content Security
Policy (CSP) to reduce the severity of any XSS vulnerabilities that still occur.
4. Broken access Control
Broken access control vulnerabilities exist when a user can in
fact access some resource or perform some action that they are not supposed
to be able to access.
• Store passwords using strong adaptive and salted hashing functions with a work
factor (delay factor), such as Argon2, scrypt, bcrypt, or PBKDF2.
• With a little help of social engineering (such as sending a link via email or chat),
an attacker may trick the users of a web application into executing actions of the
attacker’s choosing.
• If the victim is a normal user, a successful CSRF attack can force the user to
perform state changing requests like transferring funds, changing their email
address, and so forth.
• If the victim is an administrative account, CSRF can compromise the entire web
application.
Example
• <img src="http://example.com/app/transferFunds?
amount=1500&destinationAccount=attackersAcct#“ width="0" height="0"
/>
Prevent CSRF
• Include unique token in hidden field
• Verify the token on each request
• CSRFGuard
• Reauthenticate
9.Using Components With Known Vulnerabilities
• Known Security Vulnerabilities are those gaps in security that have been identified, either
by the developer/vendor of the products used, by the user/developer, or by the
hacker/intruder.
• To exploit known security vulnerabilities, hackers identify a weak component in the system
by scanning the system using automated tools (more common because these hacking
tools are available online) or by analyzing the components manually (less common,
because it takes more advanced skills).
• Attackers run automated scripts to probe web apps for known vulnerabilities and then
exploit the weaknesses discovered. A vast majority of attackers are not going to invest the
time and effort to design a custom exploit to break into your systems
Likely Vulnernable
§ If you do not know the versions of all components you use (both client-side and server-side).
This includes components you directly use as well as nested dependencies.
§ If software is vulnerable, unsupported, or out of date. This includes the OS, web/application
server, database management system (DBMS), applications, APIs and all components,
runtime environments, and libraries.
§ If you do not scan for vulnerabilities regularly and subscribe to security bulletins related to the
components you use.
§ If you do not fix or upgrade the underlying platform, frameworks, and dependencies in a risk-
based, timely fashion. This commonly happens in environments when patching is a monthly
or quarterly task under change control, which leaves organizations open to many days or
months of unnecessary exposure to fixed vulnerabilities.
§ If software developers do not test the compatibility of updated, upgraded, or patched libraries.
§ If you do not secure the components’ configurations
Examples
Somehow, an attacker found out my bank’s website uses Apache web server
version 1.3.22 on Win32. This version has a critical vulnerability that allows
remote attackers to execute arbitrary commands. As, on Windows, the web
server runs with SYSTEM privileges, this vulnerability can be exploited by the
attacker to do what he wants (steal information, stop services…) on that server.
The attacker first stops the local firewall that blocks outbound connections from
the webserver to the Internet. Then he can download a network traffic monitoring
tool, install it and start it to intercept all traffic behind the Apache web server
(after SSL termination). All login requests are intercepted and relevant
information (obviously, login and passcode) is extracted and uploaded to its
server using a simple Batch script.
Attack Scenarios
Scenario #1: Components typically run with the same privileges as the
application itself, so flaws in any component can result in serious impact. Such
flaws can be accidental (e.g. coding error) or intentional (e.g. backdoor in
component).
• Only obtain components from official sources over secure links. Prefer signed
packages to reduce the chance of including a modified, malicious component.
• Monitor for libraries and components that are unmaintained or do not create
security patches for older versions.
10. Under protected APIs
• OWASP ZAP
• https://www.owasp.org/index.php/Category:Vulnerability_Scanning_Tools
General Security Testing tools
• Iron Wasp(https://ironwasp.org/)
• Over 25 kinds of web vulnerabilities
• Wireshark(https://www.wireshark.org/)
• Network packet analyzer.
• Google Nogotofail( https://github.com/google/nogotofail)
• Known TLS/SSL vulnerabilities and misconfigurations.
• SQlMap( http://sqlmap.org/)
• Sql Injection
• Qualys(https://www.qualys.com)
Security code review
• Fastest and accurate
• Data Validation
• Authentication
• Session management
• Authorization
• Cryptography
• Error handling
• Logging
• Security Configuration
• Network Architecture
• Tools
• Code crawler
• Orizon
• O2
• FindSecurityBugs
Conclusion
We depend on information and information technology (IT) to make many of our day-to-day tasks
easier and more convenient.
Cyberspace is vulnerable to a broad spectrum of hackers, criminals, terrorists, and state actors.
Working in cyberspace, these malevolent actors can steal money, intellectual property, or classified
information; impersonate law-abiding parties for their own purposes; damage important data; or
deny the availability of normally accessible services.
Cybersecurity issues arise because of three factors taken together - the presence of malevolent
actors in cyberspace, societal reliance on IT for many important functions, and the presence of
vulnerabilities in IT systems.
This presentation considered broad steps make security policies to protect our government,
businesses, and the public by overcoming web application vulnerabilities.
References
1. https://www.owasp.org/index.php/OWASP_AppSensor_Project
2. https://www.owasp.org/index.php/OWASP_Automated_Threats_to_Web_Applications
3. https://www.owasp.org/index.php/Credential_Stuffing_Prevention_Cheat_ Sheet
4. https://www.owasp.org/index.php/Virtual_Patching_Cheat_Sheet
5. https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project
6. https://www.owasp.org/index.php/Intrusion_Detection
7. https://www.owasp.org/index.php/Cryptographic_Storage_Cheat_Sheet
8. https://www.owasp.org/index.php/Password _Storage_Cheat_Sheet
9. https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet
10. https://www.owasp.org/index.php/Testing_for_SSL-TLS
11. https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet
12. http://lists.owasp.org/pipermail/owasp-csrfguard
Q&A @[email protected]
Thank You
Tools and Technologies for testing, building and preventing
threats