/

CVE-2026-105704

Severity:

HIGH RISK

(7.3)

Auth Bypass (CWE-287) in SourceCodester Drug Auth Guard

CVE-2026-105704

Deferred

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287

Impact:

Authentication Bypass and Unauthorized Access

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SourceCodester Drug Recommendation System 1.0 contains an improper authentication vulnerability in its Auth Guard component. Remote manipulation of the user_id argument may allow an attacker to bypass intended authentication checks and access functionality without valid authorization.

SourceCodester Drug Recommendation System 1.0 contains an improper authentication vulnerability in its Auth Guard component. Remote manipulation of the user_id argument may allow an attacker to bypass intended authentication checks and access functionality without valid authorization.

Affected context

The vulnerability appears in deployments of SourceCodester Drug Recommendation System 1.0 where the Auth Guard processes a user-controlled user_id argument. Risk is increased when authentication decisions rely on that argument without independently verifying the user's authenticated identity, session state, or access rights.

The vulnerability appears in deployments of SourceCodester Drug Recommendation System 1.0 where the Auth Guard processes a user-controlled user_id argument. Risk is increased when authentication decisions rely on that argument without independently verifying the user's authenticated identity, session state, or access rights.

Exploit preconditions

  • Attack surface: A remotely reachable application endpoint protected by the Auth Guard
  • Required access: Network access to the affected application; valid credentials may not be required if the guard accepts unauthenticated requests
  • Trigger point: Processing of the user_id argument during an authentication decision
  • Why exploitation is possible: The supplied identity value may influence authentication without sufficient server-side validation or binding to a trusted session identity
  • Attack surface: A remotely reachable application endpoint protected by the Auth Guard
  • Required access: Network access to the affected application; valid credentials may not be required if the guard accepts unauthenticated requests
  • Trigger point: Processing of the user_id argument during an authentication decision
  • Why exploitation is possible: The supplied identity value may influence authentication without sufficient server-side validation or binding to a trusted session identity

Why this happens

The underlying issue is improper authentication, mapped to CWE-287. The application appears to trust a client-controlled identity attribute when determining whether a request is authenticated, rather than deriving identity from a protected session or independently validated credential. This insecure pattern can allow authentication state to be established or evaluated from data that an attacker can alter.

The underlying issue is improper authentication, mapped to CWE-287. The application appears to trust a client-controlled identity attribute when determining whether a request is authenticated, rather than deriving identity from a protected session or independently validated credential. This insecure pattern can allow authentication state to be established or evaluated from data that an attacker can alter.

Potential impact

  • An attacker may bypass authentication controls
  • Unauthorized users could access protected application functionality
  • Sensitive recommendation or user data could be exposed
  • Attackers could modify records or perform actions under another user's identity
  • The application may experience data integrity or accountability failures
  • An attacker may bypass authentication controls
  • Unauthorized users could access protected application functionality
  • Sensitive recommendation or user data could be exposed
  • Attackers could modify records or perform actions under another user's identity
  • The application may experience data integrity or accountability failures

General mitigation guidance

Mitigation generally focuses on making authentication decisions independent of client-controlled identity parameters.

Common defensive patterns include:

  • Deriving the authenticated user from a server-managed session or strongly validated token
  • Treating user_id and similar request parameters as untrusted input
  • Verifying that the authenticated principal is authorized to access the requested user record
  • Applying fail-closed authentication and authorization checks at every protected endpoint
  • Limiting application identities and database permissions according to least privilege
  • Avoiding detailed authentication error responses that disclose identity or authorization state

Mitigation generally focuses on making authentication decisions independent of client-controlled identity parameters.

Common defensive patterns include:

  • Deriving the authenticated user from a server-managed session or strongly validated token
  • Treating user_id and similar request parameters as untrusted input
  • Verifying that the authenticated principal is authorized to access the requested user record
  • Applying fail-closed authentication and authorization checks at every protected endpoint
  • Limiting application identities and database permissions according to least privilege
  • Avoiding detailed authentication error responses that disclose identity or authorization state

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules that identify authentication decisions based directly on request parameters
  • Code review checks for missing session-to-user identity binding
  • Tests that alter identity-related parameters while preserving the same authentication context
  • Web application monitoring for protected requests with inconsistent or unexpected user identifiers
  • Policy enforcement requiring centralized authentication middleware and explicit authorization checks

Automated security review tools may help identify endpoints where user-controlled identity data reaches authentication logic.

Organizations can look for this issue through:

  • Static analysis rules that identify authentication decisions based directly on request parameters
  • Code review checks for missing session-to-user identity binding
  • Tests that alter identity-related parameters while preserving the same authentication context
  • Web application monitoring for protected requests with inconsistent or unexpected user identifiers
  • Policy enforcement requiring centralized authentication middleware and explicit authorization checks

Automated security review tools may help identify endpoints where user-controlled identity data reaches authentication logic.

Sources

SourceLink
github.comgithub.com/hackliu/Vulnerability-Reports/blob/master/Drug-Recommender-Web-App/VULN-02-Broken-Access-Control.md
vuldb.comvuldb.com/cve/CVE-2026-105704
vuldb.comvuldb.com/submit/992051
vuldb.comvuldb.com/vuln/413697
vuldb.comvuldb.com/vuln/413697/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Yes. The description indicates that the affected authentication behavior can be triggered remotely through the application's attack surface.

Not necessarily. The key condition is the ability to reach an affected endpoint and influence the user_id value used by the Auth Guard. Deployment-specific controls may add additional requirements.

Authentication should be based on a server-controlled session or independently validated credential, with authorization checks performed against that trusted identity rather than a client-supplied user identifier.

Treat identity parameters as untrusted, centralize authentication logic, test for parameter tampering, enforce least privilege, and require code review or automated analysis for authentication and authorization changes.

Yes. The description indicates that the affected authentication behavior can be triggered remotely through the application's attack surface.

Not necessarily. The key condition is the ability to reach an affected endpoint and influence the user_id value used by the Auth Guard. Deployment-specific controls may add additional requirements.

Authentication should be based on a server-controlled session or independently validated credential, with authorization checks performed against that trusted identity rather than a client-supplied user identifier.

Treat identity parameters as untrusted, centralize authentication logic, test for parameter tampering, enforce least privilege, and require code review or automated analysis for authentication and authorization changes.

Find out what's already
exploitable in your codebase.