OpenSIPS SQL Injection Vulnerability in auth_jwt Module Allows Authentication Bypass

Vulnerability

A SQL injection vulnerability has been identified in the OpenSIPS authentication module for JSON Web Tokens (JWT), specifically in versions 3.1 prior to 3.6.4. The vulnerability arises in the jwt_db_authorize() function, where the module extracts the 'tag' claim from a JWT without verifying its signature. This unescaped value is then directly inserted into a SQL query. An attacker can exploit this by crafting a JWT with a malicious tag claim to manipulate the query results, bypassing JWT authentication and allowing impersonation of any user.

Impact

Exploitation of this vulnerability could lead to unauthorized access by bypassing JWT authentication, allowing attackers to impersonate legitimate users.

Reproduction

To reproduce this vulnerability, first ensure that OpenSIPS is running a version between 3.1 and 3.6.4 with the auth_jwt module enabled. The jwt_db_authorize() function will decode JWT tokens without verifying their signatures, allowing an attacker to inject SQL payloads through the 'tag' claim. This can be done by crafting a JWT that includes a malicious SQL injection payload in the tag claim, such as one that exploits the SQL query handling in the vulnerable function.

Remediation

Users can upgrade to OpenSIPS version 3.6.4 or later, where this vulnerability has been fixed.

Added: Feb 25, 2026, 11:07 PM
Updated: Feb 25, 2026, 11:07 PM

Vulnerability Rating

Custom Algorithm
spread
5.2
impact
3.1
exploitability
9.3
remediation
7.7
relevance
3.5
threat
4.8
urgency
2.9
incentive
8.3

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.