Back to the topic overview

Application security

Web App Security

Web application security means making sure an application does only what it should. That must still hold when someone sends unexpected or harmful input. The code matters, but so do its configuration and hidden assumptions.

This page follows a request through an application. It shows where trust changes, where risk builds up, and why common safeguards are often misunderstood.

What web application security actually protects

The goal is not to make software impossible to attack. It is to protect data, prevent unauthorized actions, and keep the service available. Security controls support one or more of these goals.

The key idea is the trust boundary. The user controls the browser, so the server cannot trust form fields, cookies, headers, URLs, or uploads. The same rule applies when data moves between an API and a supplier, an application and its database, or two services with different permissions.

Many vulnerabilities start when an application trusts data too early. It may treat input as a database command, accept a user's claim about what they may access, or place stored data into a page as executable code. OWASP groups these recurring failures into broad awareness categories.

Frameworks can provide safe defaults. But they do not know which customer owns a record or who may approve a payment. The application still has to make those decisions.

How a request moves through an application

Follow one request from the browser to the response. Each stage makes a different security decision.

  1. 01 · Transport

    HTTPS protects data while it travels over the network. It does not make the application behind it secure.

  2. 02 · Entry point

    The server turns the request into paths, parameters, headers, and cookies. All of that data is untrusted.

  3. 03 · Authentication

    The application checks who sent the request. It usually validates credentials, a session, or a token. This proves identity, not permission.

  4. 04 · Session

    A session or token represents the user after login. If someone steals or predicts it, they may act as that user without knowing the password.

  5. 05 · Authorization

    The server must check whether this user may perform this action on this record. A hidden button is not an access control.

  6. 06 · Input handling and business logic

    Validation limits what the application accepts. Business logic decides what the data means. Bugs here can allow negative quantities, skipped payment steps, or access to another user's record.

  7. 07 · Data access and output

    Database queries must treat input as data, not code. Output encoding stops stored content from becoming script in a browser. Input validation and output encoding solve different problems.

Where risk tends to concentrate

The same weak points appear across many applications. These are good places to start.

Authentication

Check passwords, account recovery, rate limits, and multi-factor authentication. Recovery needs strong checks because it can bypass the password.

Authorization

Look for missing checks on records and actions. The server must enforce the application's real ownership and permission rules on every request.

Sessions and tokens

Review cookie settings, token lifetimes, and what happens after logout or a password change. Long-lived tokens need a clear way to revoke them.

APIs

APIs expose application logic without the interface around it. Every endpoint needs a clear access rule, including internal endpoints.

Dependencies and configuration

Packages, base images, and infrastructure defaults are part of the application. Track them, update them, and remove what you no longer use.

Error handling and logging

Detailed errors can expose the system. Missing logs make incidents harder to understand. Log useful security events, but keep secrets out of the logs.

Business logic

Valid steps can become harmful when combined. Examples include reused discounts, repeated requests, and skipped checks. Scanners rarely understand these rules.

A realistic request-flow example

A logged-in user asks an invoicing app for invoice 8241 as a PDF. The connection is encrypted. The session is valid. The endpoint confirms that the user is logged in, then returns the file.

But it never checks who owns invoice 8241. Any logged-in user can change the number in the URL and read another customer's invoice.

TLS, password hashing, and session handling all worked. The data still leaked because one authorization check was missing.

The fix is to load the invoice through the authenticated account. A framework or scanner cannot decide that ownership rule for the team.

Common misunderstandings

These claims sound plausible. Each one leaves out an important part of security.

“HTTPS makes the application secure”

TLS protects the connection. It does not fix injection, broken access control, or business-logic flaws.

“Authentication covers authorization”

Identity and permission are separate checks. A valid login does not grant access to every record or action.

“Input validation replaces output encoding”

Validation controls what enters the application. Encoding controls how output is interpreted. You need both.

“UI restrictions enforce server-side security”

Users can bypass disabled buttons, hidden fields, and browser checks by sending requests directly. The server must enforce the real rules.

“A clean scan means a secure application”

Scanners find known patterns. They do not fully understand ownership, business rules, or how several small flaws work together.

“The OWASP Top 10 is a complete checklist”

The OWASP Top 10 is an awareness document, not a complete test plan. The ASVS provides more detailed verification requirements.

What testing can and cannot prove

A security test covers one version, one configuration, and a limited amount of time. It can prove that a weakness exists. It cannot prove that no other weakness exists. Every meaningful change can alter the result.

Security therefore has to stay part of development. Standards such as the OWASP ASVS help teams decide what to check. The risk and rate of change help decide when to check again.

  • A finding proves a weakness; a clean report does not prove the absence of one
  • Technical severity and business impact are not the same
  • Test results become less useful as the application changes
  • Tools support judgement; they do not replace it
  • Only test systems you own or have explicit permission to test

Key takeaways

  • 01Mark every place where data moves from someone else's control into yours.
  • 02Check identity first, then check permission for each action and record.
  • 03Validate input and encode output. They solve different problems.
  • 04Treat dependencies and configuration as part of the application.
  • 05Use the OWASP Top 10 for awareness and the ASVS for detailed checks.
  • 06Treat every test as a snapshot, not a guarantee.

Sources and further reading

A compact selection of primary sources, standards, and public technical guidance used to ground this article.