DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Data
  4. Top 5 Application Vulnerabilities: How to Prevent Risks

Top 5 Application Vulnerabilities: How to Prevent Risks

Want to learn more about you can prevent risks in your applications? Check out this post to learn more about the top 5 application vulnerabilities!

Thanh Tran user avatar by
Thanh Tran
·
Oct. 26, 18 · Presentation
Like (2)
Save
Tweet
Share
9.35K Views

Join the DZone community and get the full member experience.

Join For Free

A web application in today’s environment can be affected by a wide range of issues, resulting in serious damage to an individual application or the overall organization. To build a secure and stable application, you must first recognize different attacks that can make the application vulnerable. The order of the following list is based on the risk factor of each application vulnerability and is intended to help you prevent attacks from taking place.

1. Injection

The highest vulnerability risk is injection, and it has been for decades. Almost anything can be injected, such as SQL queries, LDAP, Xpath, NoSQL queries, expression languages, etc. It can occur whenever a user is allowed to input untrusted data via forms, URL, or anything that can be sent back to the application/system. Any new expression or query-like language can be exploited if not implemented correctly.

How to Prevent

  • Any untrusted source of data must be validated on the server side.
  • Limit the input data by implementing a whitelist instead of a blacklist — you never know what might be out there that can harm your system.
  • If possible, use safe APIs and parameterized queries. Most frameworks support this process.

2. Broken Authentication

Broken authentication vulnerabilities occur when session management is not handled properly on the server side. Attackers can reuse a session ID or token to gain access. It can also occur if weak authentication or weak recovery methods are used.

How to Prevent

  • Most advanced frameworks have reliable and secured session management. If you must implement your own, ensure the session ID is randomized and the session is invalidated correctly. Never expose your session ID via URL or any visible location on the screen.
  • Implement a weak-password check.
  • It seems like a good idea to enforce users to change their password once in a while. In reality, however, this does not prevent the problem as users tend to rotate their own passwords for easy memorization. A better way to ensure password security is the implementation of a multi-factor authentication.

3. Sensitive Data Exposure

Sensitive data can be exposed to attackers in many ways. The most common exposures happen when data is transferred in plain text or using weak encryption. The following is an example of data sent over an unsecured network using weak encryption (base64encode):

GET /api/secured HTTP/1.1
Authorization: Basic YXVkaXQtd3M6TGV4aXNAMjAxOA==



How to Prevent

  • Ensure data is transferred via a secure layer (e.g. https over HTTP, ssh over telnet, sftp over ftp, etc). Using https might prevent exposing plain text data transferred over the Internet. As https is very affordable nowadays, it’s a great option to secure a site. For internal data transfers, however, always use a secured layer as people tend to keep data in plain text for faster transmission time.
  • Stored passwords should use strong adaptive and salted hashing functions.
  • Keep your encryption algorithm up-to-date and make sure to choose a good key size for your secret. Choose your key size wisely, since there is a tradeoff between key size and performance.

4. XML External Entities

Attackers can add XXE in place of an XML file and send it back to the server. This can be confused with the injection vulnerability, but it’s actually a privilege abuse method used to exploit many old XML processors. Any XML processor or SOAP-based web services that has DTDs enabled can be the target. Developers should be aware of the injection vulnerability; however, XML External Entities are not commonly seen, thereby significantly increasing the risk of this type of attack.

How to Prevent

  • If possible, try to use a less complex data format, such as JSON.
  • Patch/update all XML processor libraries and use SOAP 1.2 or higher.
  • Disable XML External Entity and DTD processing in your XML parser.
  • To prevent a worst-case scenario when enabling that support, make sure to implement a whitelist and have a custom implementation to validate the input.

5. Broken Access Control

Attackers can have access to unauthorized resources via different means. Most likely, there is a flaw in the implementation to prevent users from accessing unauthorized resources. For example:

POST /api/person/1/change-password
{‘password’: ‘new_password}


By changing “1” to a different User ID, the attacker can change the password for any given user (not just himself).

How to Prevent

  • Deny default access to all non-public resources.
  • Always check for user privilege at the server side.
  • Disable CORs or minimize its usage.

Other vulnerabilities that are commonly seen and exploited are XXS or CSRF. They are not included in this list, however, because advanced frameworks nowadays are mostly able to take care of the vulnerabilities through default configurations.

Following these best practices in security will gain be huge value in return, especially in the early stages of development. You never want to run the risk of losing your valuable and sensitive data due to flaws in implementation. Some general rules of thumb that you should consider are:

  • Subscribe to various forums that share the latest vulnerabilities along with the CVE.
  • Always keep your library up-to-date with the latest patches.
  • Define a security process that makes it fast and easy to develop, test, and deploy applications. Automated processes that leverage tools, such as Burbsuite, are very beneficial.
application Vulnerability Data (computing) Plain text XML

Published at DZone with permission of Thanh Tran. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Why It Is Important To Have an Ownership as a DevOps Engineer
  • Mind Map Reuse in Software Groups
  • Taming Cloud Costs With Infracost
  • Hidden Classes in Java 15

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: