Security Isn't Optional — It's a Requirement
In 2024, Europe recorded 1,200+ significant data breaches with total GDPR fines exceeding €2 billion. Web application security is no longer just the IT department's responsibility — it's a business risk.
Devs.lv has been conducting security audits and GDPR compliance assessments for 8+ years. In this article, we share a practical guide any business can implement.
OWASP Top 10 — Most Common Threats
1. Injection (SQL, XSS, LDAP)
Still the #1 vulnerability worldwide. The solution is simple but requires discipline:
- Parameterized queries — never use string concatenation in SQL queries
- ORM usage — Prisma, TypeORM, Sequelize automatically protect against SQL injection
- Content Security Policy — CSP headers block XSS attacks even if code is vulnerable
- Input validation — validate ALL input data on the server (not just client-side)
2. Authentication Failures
Weak passwords, no MFA, session management issues — the classics:
- MFA mandatory — at minimum for admin users, ideally for everyone
- Password policy — minimum 12 characters, checking against
haveibeenpwneddatabase - Session limits — automatic session expiry after inactivity, secure cookies (HttpOnly, Secure, SameSite)
- Rate limiting — block brute-force attempts (max 5 tries, then lockout)
3. Sensitive Data Exposure
API responses returning more data than needed. Logs with personal data. Unencrypted databases.
- API response filtering — return only necessary fields (not the entire database row)
- Encryption — TLS 1.3 for transport, AES-256 for sensitive data at rest
- Log sanitization — never log passwords, API keys, personal identification numbers
GDPR Compliance — Practical Steps
Consent Management
Every web application needs:
- Cookie banner with granular consent (not just "Accept all")
- Consent Mode v2 — Google requirement since March 2024. Affects GA4, Google Ads
- Consent log — record when and what the user consented to. Authorities may request proof.
Data Processing Register
GDPR Article 30 requires documenting:
- What personal data you collect and why
- Where data is stored (EU or outside EU)
- How long you retain data
- Who has access
Right to Erasure
Users have the right to request deletion of their data. Your system must be able to:
- Identify all user data across all systems (database, logs, backups, third-party services)
- Delete or anonymize data within 30 days
- Confirm deletion to the user
Security Headers — Quick Win
These HTTP headers protect against the most common attack vectors. Implementation takes 30 minutes:
Content-Security-Policy— blocks XSS and data injectionStrict-Transport-Security— enforces HTTPS (HSTS)X-Frame-Options: DENY— protects against clickjackingX-Content-Type-Options: nosniff— prevents MIME type sniffingReferrer-Policy: strict-origin-when-cross-origin— limits referrer informationPermissions-Policy— blocks unnecessary browser APIs (camera, microphone, geolocation)
Devs.lv example: in our Next.js projects, all these headers are set at the middleware level, automatically applied to every request.
Regular Security Audits
Security isn't a one-time action. Recommended cycle:
- Weekly: automated dependency scanning (
npm audit, Snyk, Dependabot) - Monthly: OWASP ZAP or Burp Suite scanning
- Quarterly: manual penetration test (internal or external)
- Annually: full security audit with GDPR compliance check
Incident Response Plan
GDPR requires notifying authorities about data breaches within 72 hours. You must be prepared:
- Contact person — who calls the authority and customers?
- Investigation process — how do you identify the breach scope?
- Communication plan — prepared templates for customers and press
- Technical response — how do you isolate and fix the issue?
Conclusion
Web security and GDPR compliance aren't complicated — they require a systematic approach and regular maintenance. Start with security headers and OWASP Top 10, then move to GDPR documentation and regular audits.
Need a security audit? Devs.lv offers web application security audits that include OWASP testing, GDPR compliance assessment, and a concrete recommendation plan. Results within 5 business days.
