Skip to main content
System Defense

Web Application Security Basics

Explore web application security basics. Learn about auth walls, GDPR compliance for UK users, WCAG scope, back-ups, and escaping vendor lock-in.

Obaid Tariq
Obaid Tariq
Updated 5 min read
Cover illustration for Web Application Security Basics
Table of Contents (6 sections)▼

Overview

Here's the short version: hardening a platform means far more than installing an SSL certificate. Secure web application development is a set of decisions — about identity, data, access, and ownership — and most of them have to be made before the first sprint, not after launch.

Auth and role walls.

A marketing site needs no login, because it broadcasts to everyone. A portal is the opposite: it blocks entry until you prove who you are. OAuth 2.0 or JSON Web Tokens force the browser to prove its identity on every request for restricted data — not once at login, every time.

Then comes the role wall, and this is the part people skip. A junior HR assistant logs in with a valid token, but when their screen asks for the CEO salary matrix, the backend checks the role on that token and refuses. Same app, same URL — completely different data. For the database-level version of this, our guide to secure customer portal development covers Row Level Security and role-based permissions in detail. The rule is simple: authentication proves who you are, authorisation decides what you see, and the backend enforces both. Never trust the frontend to do it.

GDPR for a UK user base.

If your users are in the UK or Europe, GDPR shapes your database design from day one — it's not a policy page you add at the end. UK citizens have the legal right to demand complete deletion of their personal data, and that means your backend has to trace every record back to the person it belongs to and delete it across every table it touched. No orphaned rows, no forgotten backups with live personal data in them.

Consent is the other half. You need verifiable logs showing exactly when a user agreed to tracking — not a vague "we use cookies" banner. And data at rest and in transit must be encrypted. We've seen teams treat GDPR as a legal checkbox and then discover, months after launch, that their database literally can't delete a user properly. That's a rebuild, not a patch. Scope it from the first sprint.

Accessibility as scope, not a badge.

Accessibility gets misunderstood constantly. WCAG 2.1 AA isn't a badge you stick on a finished app — it's a scoping decision. It means semantic HTML that screen readers can navigate, keyboard-only flows across complex dashboards, proper contrast ratios, and aria-labels that tell assistive technology exactly what a control does when it changes state.

Here's what doesn't work: a third-party "accessibility overlay" slapped on after launch. It fails proper WCAG 2.1 AA audits, every time, because the underlying structure was never built for it. If a dropdown doesn't announce that it's expanded, a visually impaired user hits a wall — no overlay fixes that. Build accessibility into the first sprint and it costs a reasonable amount of frontend time. Bolt it on later and it costs far more, for a worse result. We don't recommend any other order.

Backups and who can export the data.

Backups are the part nobody thinks about until the worst day of the year. The standard is simple: automated, encrypted PostgreSQL snapshots pushed to a separate region, so if your primary London cluster goes down, a secondary cluster can take over. Test the restore, not just the backup — an untested backup is a hope, not a plan.

But backups create their own risk: who can export the data? A junior admin should never be able to download the entire customer table onto a laptop. Export permissions are an internal threat layer, and they need to be as tightly controlled as the login itself. When we scope a build, we decide in week one who can export what — and we write it down, because "someone in the office has access" is how data walks out the door.

Vendor lock-in when the builder hosts the only copy.

This is the trap that costs founders the most, and it's entirely avoidable. If your agency holds the only root SSH keys to your production server, they own your business continuity — not you. Dispute an invoice and your application can go dark. That's not a hypothetical; it's a hostage situation, and we've seen it happen.

The fix is structural, and it happens before the build starts. You register the cloud accounts in your company's name. You grant the agency limited IAM roles — enough to deploy, nothing more. The code lives in your GitHub from day one, and the infrastructure is yours. That's our rule on every engagement, and we recommend you demand it from any vendor.

There's a second layer people miss: documentation. Even with the code and the servers in your hands, migrating away from a hostile agency is brutal without it — reverse-engineering a database schema from scratch can take quarters. A transparent agency ships up-to-date OpenAPI or Swagger specs alongside the code, so any competent team can pick it up. A raw SQL dump without documentation isn't ownership. Code, infrastructure, and docs — all three, in your hands, from the start.

Audit Your Application

Concerned about data leakage in your current custom build?

Request an Audit
Obaid Tariq

Written by

Obaid Tariq

Founder & Lead Engineer at AI Dev Planner

Technical Practice:Next.js App Router, TypeScript, Multi-Tenant PostgreSQL (Row-Level Security), Supabase, and Deterministic Applied AI Integration. Direct founder-led engineering without sales reps or outsourced development.

Published: Updated:

More blogs

View more

Get the latest insights

Practical ideas for building better products, delivered directly to your inbox.

Case studies

Proven Implementations

Inspect related architectures, engineering metrics, and example systems for these capabilities.

View Full Portfolio
FinTech & Capital MarketsIllustrative Example — Composite Scenario
2024 · Custom Software Development

Migrating Core Infrastructure for a Global Financial Services Firm: Cloud-Native Microservices Architecture

Composite example: trading & asset-management firm (UK/North America)
London, UK & New York, USA
Business problem

Aging on-premise monolith suffered severe database lock contention and multi-second batch reconciliation drift during peak volatility, risking trader execution SLAs and regulatory audit compliance.

Executed deliverables

Complete redesign and deployment of the transactional backbone, asynchronous event streaming pipeline, and real-time execution cockpit.

Core technologies
AWS (ECS/Fargate)Apache Kafka (Amazon MSK)Next.jsNode.js+3
Example highlights (illustrative composite, design targets)
  • Zero Downtime Phased Strangler Cutover
  • Sub-20ms Real-Time WebSocket Feeds
  • 100% Immutable Kafka Audit Event Log
Healthcare & Clinical OperationsIllustrative Example — Composite Scenario
Illustrative · Customer Portal Development

Patient Intake Portal & EHR Integration (Illustrative Example)

A multi-clinic outpatient network (illustrative scenario)
United States (illustrative scenario)
Business problem

In this illustrative scenario, manual front-desk intake slows check-in, invites transcription errors, and delays insurance verification across a multi-clinic outpatient network.

Executed deliverables

The plan covers a responsive, mobile-friendly pre-registration web app, a clinical verification dashboard, and HL7/FHIR integration adapters.

Core technologies
ReactNode.jsGoogle Cloud KMSGoogle Cloud Vision OCR+2
Example highlights (illustrative composite, design targets)
  • Encrypted PHI Field-level Cloud KMS encryption (design target)
  • 100% Clinician Review Every extracted field verified before EHR write (design target)
  • Zero PHI Leakage Design target, not a measured result