Select Page

7 Steps to Website Application Security You Can Check Yourself

by | Dec 2, 2026 | Web Security

Website application security comes down to seven jobs done in order. You list what you run, lock down logins and permissions, and treat every input as hostile. Then you encrypt traffic, harden the server, patch and test, put a filter in front, and finally watch, back up and rehearse your response.

Each step below tells you what to do and how to check it’s really done. You can work through it on a client site, a SaaS dashboard or your own agency stack in a few focused sessions.

A list of security best practices is easy to agree with and easy to half-apply. A setting switched on but never tested protects nothing, and nobody notices until a breach. That’s why every step here ends with a concrete check you can run in minutes.

What web application security covers, and where attacks land

In cyber security terms, web application security is the part that protects the code, data and users of an app reached through a browser or an API. Network security guards the pipes and machines; application security guards what they serve: forms, logins, the database and the logic that decides who sees what.

The mechanism is simple, and it explains every security threat that follows.

A visitor’s browser sends a request, your web server passes it to the application code, the code queries a database and sends back a page or JSON. An attacker plays the same game with crafted requests. Every place where your app accepts data is an entry point: a URL parameter, a form field, a cookie, an uploaded file or an API call. All of them together form the attack surface.

The threats that matter most

  • SQL injection: input reaches a query written in SQL (Structured Query Language), the language databases speak. When that input is read as code, the attacker can read or change data.
  • Cross-site scripting (XSS): injected JavaScript runs in other users’ browsers and hijacks sessions or rewrites pages.
  • Cross-site request forgery (CSRF): a logged-in user’s browser is tricked into sending an action they never chose.
  • Broken access control: a user reaches data or functions meant for someone else, often by changing an ID in a URL.
  • Misconfiguration and outdated components: default credentials, verbose errors, an old plugin with a known flaw.
  • DDoS attacks: traffic floods that knock the app offline.

The two reference bodies you’ll hear about

OWASP, the Open Worldwide Application Security Project, is a nonprofit that publishes free security guidance. Its best-known output is the OWASP Top 10, a ranked list of the most critical web application security risks. In the 2021 edition, broken access control sits at number one and injection, which now includes XSS, at number three. Its Application Security Verification Standard (ASVS) turns those risks into testable requirements.

The National Institute of Standards and Technology (NIST), a United States agency, writes standards rather than developer checklists. Two of its documents matter here. Special Publication (SP) 800-63B covers authentication and passwords. The Secure Software Development Framework (SSDF, SP 800-218) describes how to build security into the software development lifecycle (SDLC), the stages from design to release and maintenance.

Why bother on a small site? Because data breaches don’t only hit banks, and stolen personal information or credit card numbers cost any business its reputation. The Verizon 2022 Data Breach Investigations Report named web applications the top attack vector among more than 18,000 security incidents. The Cost of a Data Breach Report 2024 from IBM, the technology company, put the average global cost of a breach at $4.88 million.

web application security

Step 1: Inventory the application and shrink its attack surface

You can’t protect what you haven’t listed. Write one inventory sheet per application. List:

  • its domains and subdomains, hosting and server;
  • its content management system (CMS) or framework, with the version;
  • every plugin or third-party library;
  • every API it calls or exposes, and every admin account.

Note where sensitive information lives, such as user data, payment details or credentials.

Then cut. Remove plugins nobody uses, old staging copies still online, test accounts and forgotten admin pages. Each removal closes an entry point for good, which is cheaper than defending it forever. On WordPress, deleting a deactivated plugin matters, because its files remain reachable on the server until you do.

Rank the inventory by risk: anything that handles logins, payments or personal data comes first. If you handle card data, the Payment Card Industry Data Security Standard (PCI DSS) applies to that part of the app. If you process personal data on people in the EU, the General Data Protection Regulation (GDPR) applies too, and step 7 covers what it demands. Treat compliance as a floor, not a finish line.

How to check it’s done: every item on the sheet has an owner and a version number. Your DNS records (the domain name system entries that point names to servers) show no subdomain missing from the sheet. A forgotten dev. or old. subdomain is a classic way in.

step 2 lock down authentication sessions and access

Step 2: Lock down authentication, sessions and access control

Authentication proves who a user is; authorization decides what they may do. Unauthorized access almost always goes through one of the two, so strong authentication comes before any tool purchase.

Passwords and multi-factor authentication

  • Change every default credential, and never hard-code usernames or passwords in source code or config files kept in a repository.
  • Store passwords with a slow, salted hashing function such as bcrypt or Argon2, never as plain text or a fast hash.
  • Turn on multi-factor authentication (MFA) for every admin account, and offer it to users.
  • Follow NIST SP 800-63B: check new passwords against lists of known breached passwords, and don’t force periodic changes unless there’s a sign of compromise.
  • Limit login attempts. On a Linux server, Fail2Ban can ban IP addresses that keep failing.

Session management and cookies

A session cookie is a key to the account, so set it with the Secure, HttpOnly and SameSite attributes. The cookie then travels over HTTPS only, stays unreadable by JavaScript and isn’t attached to most cross-site requests. Never put sensitive data inside a cookie. Expire idle sessions, regenerate the session ID at login, and ask for the password again before sensitive actions like changing an email address.

Access control and least privilege

Check permissions on the server for every request, never only by hiding a button in the interface. Give each role the minimum rights it needs (the principle of least privilege), including database users and API keys. A content editor doesn’t need plugin installs; a reporting script doesn’t need write access.

How to check it’s done: log in as a low-privilege user, copy the URL of an object that belongs to another account and change the ID. You should get a 403 or 404, not the data. Then inspect your session cookie in the browser’s developer tools and confirm the three flags are set.

Step 3: Validate input and encode output

This step blocks injection, XSS and CSRF, the three classics in every incident report. The rule is to trust nothing that comes from the client, including hidden fields, headers and cookies.

Input validation on the server

Validate every input against an allowlist of what’s expected: type, length, format and range. Client-side validation helps the user but protects nothing, because an attacker sends requests directly. For database access, use parameterized queries so user input is never read as SQL:

$stmt = $pdo->prepare('SELECT * FROM orders WHERE id = ? AND user_id = ?');
$stmt->execute([$orderId, $currentUserId]);

On WordPress, $wpdb->prepare() does the same job. In Laravel or Django, the query builder and ORM (object-relational mapper, the layer that writes queries from your code) parameterize for you. The risk returns only with raw queries built by string concatenation.

Output encoding and CSRF tokens

Encode data for the context where it’s displayed: HTML, attribute, JavaScript or URL. Template engines like Blade, Twig or React escape HTML by default, so the risk sits in the places where developers switch that off. For CSRF, every form that changes state carries a token the server checks; Laravel’s @csrf directive and WordPress nonces provide this.

Handle errors with care as well. A stack trace shown to visitors hands an attacker your file paths, library versions and sometimes queries. Show a generic message and send the detail to your logs.

How to check it’s done: type ' and <script>alert(1)</script> into your search box and forms. The first should never produce a database error, and the second should appear as plain text, not run. Submit a form with the CSRF token removed: the server must reject it.

step 4 encrypt traffic and harden the server

Step 4: Encrypt traffic and harden the server

Encryption protects data in transit between browser and server, and at rest in databases and backups. Use HTTPS on every page. Its encryption layer, TLS (Transport Layer Security), should run at version 1.2 as the floor and TLS 1.3 where your server supports it. Free certificates from Let’s Encrypt remove any cost argument.

Then send the browser security instructions through HTTP headers:

  • Strict-Transport-Security (HSTS, defined in the internet standard Request for Comments 6797) forces HTTPS on return visits.
  • Content-Security-Policy (CSP) lists the sources allowed to load scripts, styles and frames, which limits the damage of an XSS flaw.
  • X-Content-Type-Options: nosniff stops the browser from guessing file types.
  • The CSP frame-ancestors directive, or X-Frame-Options, blocks clickjacking through hidden frames.

Harden the server itself, because misconfiguration is as dangerous as bad code:

  • disable directory listing and turn off unused services and modules;
  • allow remote shell access (SSH, secure shell) by key only;
  • keep secrets such as API keys in environment variables outside the web root.

On WordPress, setting define('DISALLOW_FILE_EDIT', true); in wp-config.php removes the built-in theme and plugin editor, a favourite tool of attackers who steal an admin login. If you run containers, use trusted images and never run them as root.

How to check it’s done: run curl -sI https://yoursite.com and read the headers in the response. The free SSL Labs test from Qualys grades your setup (SSL, Secure Sockets Layer, is the older name of TLS) for free, and Mozilla Observatory scores your headers. Fix anything below an A before moving on.

Step 5: Patch dependencies and test the code

Modern applications often pull in a long list of open-source libraries, and attackers look for sites running versions with a published flaw. Secure coding practice can’t help when the hole sits in someone else’s code. Patch the CMS, framework, plugins, libraries and server software up to date, and remove anything abandoned by its maintainer.

Automated checks you can run today

  • Software composition analysis (SCA): npm audit, composer audit or pip-audit list dependencies with published vulnerabilities. Dependabot or Renovate open update pull requests for you.
  • Static application security testing (SAST) reads your source code for dangerous patterns before release. Semgrep and SonarQube are common choices.
  • Dynamic application security testing (DAST) attacks the running app from outside, like a visitor would. ZAP (formerly OWASP ZAP) is free and scriptable.

Put SCA and SAST in your CI/CD pipeline, the automated build that runs on each commit, so a vulnerable change fails before it ships. Run a DAST scan against staging before each major release.

Penetration testing and audits

Automated tools miss logic flaws, like a discount code that can be applied twice or an order you can view by guessing its number. A penetration test, where a human expert attacks the app with your permission, finds those. A reasonable rhythm is one test a year and after any major change to authentication, payments or architecture. Use the OWASP Web Security Testing Guide or ASVS as the scope, so the report maps to known categories.

How to check it’s done: your dependency audit reports zero high or critical known vulnerabilities. The pipeline blocks a merge when it finds one, and each finding of the last security audit has a fix date.

step 6 put a web application firewall and

Step 6: Put a web application firewall and DDoS protection in front

A web application firewall (WAF) sits between visitors and your app and inspects each HTTP request. It blocks patterns that look like SQL injection, XSS or path traversal, and it can rate-limit login pages and APIs. It buys time when a new flaw appears before you can patch, which is why it comes after secure code, not instead of it. No WAF makes vulnerable code safe.

When people ask about the top WAF solutions, the useful answer is which type fits your setup:

Type Examples Fits Avoid if
Cloud WAF with a content delivery network (CDN) Cloudflare, Akamai, Fastly, Sucuri Agency portfolios, small teams, DDoS protection included You can’t change DNS for the domain
Cloud provider WAF Amazon Web Services (AWS) WAF, Azure WAF, Google Cloud Armor Apps already hosted on that cloud You’re on shared hosting or several clouds
Self-hosted rules engine ModSecurity with the OWASP Core Rule Set Teams that manage their own servers Nobody has time to tune false positives
Plugin-level firewall Wordfence for WordPress Single WordPress sites on modest budgets The site faces heavy traffic floods

Start in log-only or monitoring mode for a few days, read what would have been blocked, then switch to blocking. Add rate limits on login, password reset and search endpoints, and use IP filtering for admin areas when your team works from fixed addresses.

How to check it’s done: request https://yoursite.com/?id=1' OR '1'='1 and confirm the WAF blocks it and logs the event. Then confirm real users still log in and check out normally.

Step 7: Monitor, back up and plan your incident response

A breach often goes unnoticed for months; one IBM figure puts the average time to detect it at 192 days. Logging and monitoring close that gap. Log logins (failed and successful), permission changes, admin actions and errors, and send the logs somewhere an attacker on the server can’t erase. Never write passwords, tokens or card numbers into logs.

Set alerts on what signals trouble: spikes in failed logins, new admin accounts, unexpected file changes that hint at malware, unusual server load or traffic from odd places. Tools like Zabbix or Datadog can send those by email or SMS; a managed WAF or hosting panel often provides simpler alerts.

Backups you’ve actually restored

Back up files and databases daily, keep at least one copy off the server and away from the main account, and encrypt it. A common starting point is the 3-2-1 rule: three copies, two kinds of storage, one off-site. A backup only counts once you’ve restored it to a test environment and the app worked.

An incident response plan on one page

Write down who decides and who you call: host, developer, client. Add how to put the site into maintenance mode, which credentials to rotate first and where the clean backup is.

Under the GDPR, Article 33 requires notifying the supervisory authority within 72 hours of becoming aware of a personal data breach, unless it’s unlikely to put people at risk. Article 32 asks for security measures suited to the risk. That 72-hour clock is the reason to prepare before anything happens.

A checklist to reuse on every project

  1. Inventory complete, unused plugins and subdomains removed.
  2. Default credentials changed, MFA on every admin, session cookies flagged.
  3. Access control tested by changing an ID as another user.
  4. Parameterized queries, output encoding and CSRF tokens in place; errors hidden from visitors.
  5. HTTPS everywhere, HSTS and CSP sent, SSL Labs and Observatory at A.
  6. Dependency audit clean, SAST and SCA in the pipeline, pen test scheduled.
  7. WAF blocking, rate limits on login and reset forms.
  8. Alerts working, backup restored once, incident plan printed.

If you only have one afternoon, start with step 2 and the patching part of step 5. Stolen logins and outdated components are among the most common ways in, and both are cheap to fix.

Then work through the rest one step per week. For a web design or development team, the habit worth building is simple. Make this checklist part of every launch, the same way you test forms and mobile layouts before a site goes live.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *