Member-only story

Fixing OWASP API2:2023 — Broken Authentication in Symfony 7

Security is not an afterthought, it’s fundamental

17 min readMar 31, 2025
Generated with DALL-E

Introduction

If you’re diving into web development with PHP, Symfony 7 is an amazing framework to build robust APIs. But here’s the catch: security isn’t optional.

The OWASP API Security Top 10 highlights the most critical risks to APIs, and today, we’ll tackle API2:2023 — Broken Authentication. This vulnerability happens when an API fails to properly verify who’s accessing it, leaving the door wide open for attackers.

In this step-by-step guide, we’ll:

  • Build a simple Symfony 7 API endpoint that is vulnerable to Broken Authentication.
  • Understand why it’s vulnerable according to OWASP API2:2023.
  • Implement a fix using Symfony’s built-in security features.

By the end, you’ll have a working API, understand the security flaw, and know how to patch it.

What is Broken Authentication (API2:2023)?

OWASP API2:2023 — Broken Authentication refers to a critical security vulnerability in APIs where the authentication mechanisms fail to properly verify a user’s identity, allowing attackers to exploit weaknesses and…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Already have an account? Sign in

Tihomir Manushev
Tihomir Manushev

Written by Tihomir Manushev

Senior Backend Developer at Generic Soft

No responses yet

Write a response