Skip to content

Deelvraag 1 - OWASP Top 10:2025 Project Analyse

Terug naar hoofddocument | Deelvraag 1 - Literatuurstudie

Project: Factuur Beheer - Invoice Management System
Architectuur: Nuxt.js Frontend + Spring Boot Backend API

Dit is de uitgebreide uitwerking van Deelvraag 1: "Welke beveiligingsrisico's uit de OWASP Top 10:2025 zijn relevant voor publieke API's zonder authenticatie?"
In het hoofddocument vind je: Een samenvatting van de resultaten.
Op deze pagina vind je: Gedetailleerde risico-analyses, codevoorbeelden en OWASP Top 10:2025 evaluaties.


Project Overzicht

Technologie Stack:

  • Frontend: Nuxt.js 4.1.2 (Vue.js 3)
  • Backend: Spring Boot (Java)
  • Database: PostgreSQL

Huidige Beveiligingsstand:

  • Goed: Input validatie aanwezig (Spring Boot @Valid)
  • Goed: Error handling geïmplementeerd
  • Probleem: CORS volledig open (allowedOriginPatterns("*"))
  • Probleem: Security headers ontbreken (ZAP scan bevestigd)
  • Belangrijk: Geen authenticatie/autorisatie (buiten scope)

Niet Onderzochte OWASP Risico's

OWASP Risico Reden Niet Onderzocht
A01 - Broken Access Control Geen authenticatie/autorisatie geïmplementeerd - buiten scope onderzoek
A07 - Authentication Failures Geen echte authenticatie aanwezig - alleen mock authenticatie
A04 - Cryptographic Failures HTTPS/TLS niet geconfigureerd - niet getest in development omgeving
A03 - Software Supply Chain Dependency scanning niet uitgevoerd - focus op code analyse
A06 - Insecure Design Rate limiting niet geïmplementeerd - architectuur keuze
A08 - Data Integrity CI/CD security checks niet uitgevoerd - buiten scope
A09 - Logging and Alerting Security event logging niet geanalyseerd - basis logging aanwezig

Toelichting: Dit onderzoek focust op de basisbeveiliging van publieke endpoints zonder authenticatie. Authenticatie, autorisatie en encryptie zijn buiten scope omdat deze niet geïmplementeerd zijn. De focus ligt op injectie preventie (A05), security configuratie (A02) en error handling (A10).


OWASP Top 10:2025 - Project Analyse

A02:2025 - Security Misconfiguration

Status: 🟡 HOOG RISICO - GEDEELTELIJK ONVEILIG

Huidige Situatie

  • Probleem: CORS volledig open: allowedOriginPatterns("*") in CorsConfig.java
  • Probleem: Security headers ontbreken (ZAP scan: 3 Medium issues)
  • Goed: Hibernate DDL: validate (goed - geen auto-create)

Gevonden Problemen

1. CORS Configuratie:

// CorsConfig.java
registry.addMapping("/**")
    .allowedOriginPatterns("*")  // PROBLEEM: TOO PERMISSIVE
    .allowedHeaders("*")          // PROBLEEM: TOO PERMISSIVE

2. Security Headers (Frontend):

  • Geen Content-Security-Policy
  • Geen X-Frame-Options
  • Geen X-Content-Type-Options

Aanbevelingen

  1. CORS beperken: Alleen specifieke origins toestaan (localhost:3000, productie domain)
  2. Security headers toevoegen: Installeer @nuxtjs/security module
  3. Environment variables voor credentials (niet hardcoded)

OWASP Risico: A02 - Security Misconfiguration
Prioriteit: 🟡 HOOG - Voor productie deployment


A05:2025 - Injection

Status: 🟢 GOED GEÏMPLEMENTEERD

Huidige Situatie

  • Goed: Input validatie met @Valid annotations
  • Goed: JPA/Hibernate gebruikt (parameterized queries)
  • Goed: DTO pattern - geen directe entity exposure

Gevonden Goede Praktijken

@PostMapping
public ResponseEntity<?> create(@Valid @RequestBody ProductRequestDto requestDto) {
    // @Valid zorgt voor automatische validatie
}

// DTO met constraints
@NotBlank
@Size(max = 3)
private String currency;

Conclusie

Input validatie voorkomt SQL injection. JPA/Hibernate gebruikt parameterized queries. Vue.js escaped automatisch user input.

OWASP Risico: A05 - Injection - Goed beschermd
Prioriteit: 🟢 LAAG - Al goed geïmplementeerd


A10:2025 - Mishandling of Exceptional Conditions

Status: 🟢 GOED GEÏMPLEMENTEERD

Huidige Situatie

  • Goed: Error handling geïmplementeerd in controllers
  • Goed: Structured error responses (ErrorResponse DTO)
  • Goed: Geen stack traces in responses (goed)

Gevonden Goede Praktijken

@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseEntity<ErrorResponse> handleValidationException(...) {
    return ResponseEntity.status(HttpStatus.BAD_REQUEST)
        .body(createErrorResponse(...));
}

OWASP Risico: A10 - Exception Handling - Goed geïmplementeerd
Prioriteit: 🟢 LAAG - Al goed geïmplementeerd


A01:2025 - Broken Access Control

Status: 🔴 KRITIEK - NIET GEÏMPLEMENTEERD

Huidige Situatie

  • Probleem: Geen autorisatie checks in Spring Boot controllers
  • Probleem: Alle endpoints publiek toegankelijk zonder authenticatie
  • Probleem: Geen user context - alle gebruikers kunnen alle data zien/wijzigen

Risico's

  • IDOR: Gebruikers kunnen elkaars invoices bekijken/wijzigen
  • Ungeautoriseerde acties: DELETE/PUT endpoints zonder checks
  • Data exposure: Alle facturen, klanten en producten zijn publiek

Aanbevelingen

  1. Spring Security implementeren met JWT tokens
  2. Resource-level autorisatie: Gebruikers kunnen alleen eigen data zien
  3. Frontend: Vervang mock authenticatie met echte JWT tokens

OWASP Risico: A01 - Broken Access Control
Prioriteit: 🔴 HOOGSTE - Voor productie vereist (buiten scope onderzoek)


A07:2025 - Authentication Failures

Status: 🔴 KRITIEK - NIET GEÏMPLEMENTEERD

Huidige Situatie

  • Probleem: Geen echte authenticatie - alleen mock
  • Probleem: Geen JWT/OAuth2 tokens
  • Probleem: localStorage gebruikt (XSS kwetsbaar)

Gevonden Problemen

// useAuth.ts - Mock authenticatie
const login = async (email: string, password: string) => {
  if (email && password) {
    // PROBLEEM: Geen echte validatie
    isAuthenticated.value = true
  }
}

Risico's

  • Volledige API toegankelijk zonder authenticatie
  • Session hijacking mogelijk (localStorage)
  • Geen account lockout bij brute force

Aanbevelingen

  1. Spring Security implementeren met JWT authentication
  2. HttpOnly cookies in plaats van localStorage
  3. Password policies en account lockout

OWASP Risico: A07 - Authentication Failures
Prioriteit: 🔴 HOOGSTE - Voor productie vereist (buiten scope onderzoek)


Samenvatting: Huidige Stand vs OWASP Top 10:2025

🔴 Kritieke Risico's (Voor Productie Vereist)

Risico Status OWASP
A01 - Broken Access Control Probleem: Niet geïmplementeerd Buiten scope
A07 - Authentication Failures Probleem: Mock authenticatie Buiten scope
A04 - Cryptographic Failures Probleem: Geen HTTPS/encryptie Buiten scope

🟡 Hoge Risico's (Moet Aangepast Worden)

Risico Status OWASP
A02 - Security Misconfiguration Probleem: CORS open, headers ontbreken Aanpassen

🟢 Goed Geïmplementeerd

Risico Status OWASP
A05 - Injection Goed: Input validatie Goed
A10 - Exception Handling Goed: Error handling Goed

Conclusie

Deelvraag 1: "Welke beveiligingsrisico's uit de OWASP Top 10:2025 zijn relevant voor publieke API's zonder authenticatie?"

Antwoord op Deelvraag 1

Voor publieke API's zonder authenticatie zijn de volgende OWASP Top 10:2025 risico's het meest relevant:

  1. A02 - Security Misconfiguration: Belangrijkste aandachtspunt. De applicatie heeft te ruime CORS-instellingen en mist essentiële security headers. Dit kan leiden tot datalekken en XSS-aanvallen.

  2. A05 - Injection: Goed afgedekt in de huidige implementatie (input validatie, parameterized queries, automatische escaping).

  3. A01 - Broken Access Control en A07 - Authentication Failures: Zeer relevant voor productie, maar niet onderzocht omdat authenticatie nog niet geïmplementeerd is.

Conclusie: A02 (Security Misconfiguration) is het belangrijkste risico dat direct aangepakt moet worden. A05 (Injection) is goed afgedekt.


Sterke Punten

  • Input validatie met @Valid voorkomt injectie aanvallen
  • Error handling geïmplementeerd zonder informatie disclosure
  • DTO pattern gebruikt

Zwakke Punten

  • CORS te permissief (A02) - moet beperkt worden
  • Security headers ontbreken (A02) - moet toegevoegd worden
  • Geen authenticatie/autorisatie (A01, A07) - voor productie vereist

Aanbevolen Acties

  1. CORS configuratie beperken - alleen specifieke origins
  2. Security headers toevoegen - installeer @nuxtjs/security module
  3. Authenticatie & Autorisatie - voor productie implementeren (A01, A07)

Bronnen