/

CVE-2026-111704

Severity:

CRITICAL RISK

(9.8)

Missing Authentication (CWE-306) in LangChat REST API

CVE-2026-111704

Deferred

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306

Impact:

Unauthorized access, credential disclosure, privilege escalation, and data manipulation

Severity:

CRITICAL RISK

(9.8)

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

LangChat exposes REST controllers without registering the intended Sa-Token authentication interceptor. As a result, unauthenticated remote attackers may read sensitive credentials, create super-administrator accounts, and modify or delete application data when the affected endpoints are reachable.

LangChat exposes REST controllers without registering the intended Sa-Token authentication interceptor. As a result, unauthenticated remote attackers may read sensitive credentials, create super-administrator accounts, and modify or delete application data when the affected endpoints are reachable.

Affected context

The vulnerability occurs in LangChat deployments where REST controllers are exposed without an effective authentication interceptor or equivalent access control. The risk is greatest when the affected API is reachable over a network and endpoints such as user-management and provider-configuration operations accept requests without verifying an authenticated identity or required privileges.

The vulnerability occurs in LangChat deployments where REST controllers are exposed without an effective authentication interceptor or equivalent access control. The risk is greatest when the affected API is reachable over a network and endpoints such as user-management and provider-configuration operations accept requests without verifying an authenticated identity or required privileges.

Exploit preconditions

  • Attack surface: Network-accessible LangChat REST API endpoints
  • Required access: No prior authentication is required
  • Trigger point: Requests to exposed authentication, user-management, or data-management controllers
  • Why exploitation is possible: The expected Sa-Token interceptor is not registered, allowing requests to bypass identity and authorization checks
  • Attack surface: Network-accessible LangChat REST API endpoints
  • Required access: No prior authentication is required
  • Trigger point: Requests to exposed authentication, user-management, or data-management controllers
  • Why exploitation is possible: The expected Sa-Token interceptor is not registered, allowing requests to bypass identity and authorization checks

Why this happens

The underlying bug is a missing authentication enforcement layer. REST controllers are reachable without the interceptor that should establish an authenticated session and apply access-control rules. This maps to CWE-306: Missing Authentication for Critical Function, because sensitive operations can execute without verifying the caller's identity. The design also increases the impact of authorization failures when administrative functions are exposed through the same unauthenticated surface.

The underlying bug is a missing authentication enforcement layer. REST controllers are reachable without the interceptor that should establish an authenticated session and apply access-control rules. This maps to CWE-306: Missing Authentication for Critical Function, because sensitive operations can execute without verifying the caller's identity. The design also increases the impact of authorization failures when administrative functions are exposed through the same unauthenticated surface.

Potential impact

  • Attackers may read plaintext user passwords and LLM provider API keys
  • Attackers may create unauthorized super-administrator accounts
  • Attackers may modify or delete users, configurations, and other application data
  • Exposed provider credentials could be reused against external services
  • The application may suffer account takeover, data loss, or service disruption
  • Attackers may read plaintext user passwords and LLM provider API keys
  • Attackers may create unauthorized super-administrator accounts
  • Attackers may modify or delete users, configurations, and other application data
  • Exposed provider credentials could be reused against external services
  • The application may suffer account takeover, data loss, or service disruption

General mitigation guidance

Mitigation generally focuses on making authentication and authorization

mandatory for every sensitive controller and enforcing them by default.

Common defensive patterns include:

  • Registering and validating a centralized authentication interceptor or equivalent middleware
  • Applying explicit authorization checks to administrative and data-changing operations
  • Denying access by default when authentication middleware is unavailable or misconfigured
  • Separating public endpoints from protected controllers through an allowlist-based policy
  • Avoiding storage and exposure of plaintext passwords; store passwords using strong one-way password hashing
  • Limiting, rotating, and securely storing LLM provider API keys
  • Running service identities with only the privileges required for their functions
  • Placing management APIs behind network controls and additional administrative access boundaries

Mitigation generally focuses on making authentication and authorization

mandatory for every sensitive controller and enforcing them by default.

Common defensive patterns include:

  • Registering and validating a centralized authentication interceptor or equivalent middleware
  • Applying explicit authorization checks to administrative and data-changing operations
  • Denying access by default when authentication middleware is unavailable or misconfigured
  • Separating public endpoints from protected controllers through an allowlist-based policy
  • Avoiding storage and exposure of plaintext passwords; store passwords using strong one-way password hashing
  • Limiting, rotating, and securely storing LLM provider API keys
  • Running service identities with only the privileges required for their functions
  • Placing management APIs behind network controls and additional administrative access boundaries

How teams detect issues like this

Organizations can identify similar weaknesses through:

  • Static analysis and framework checks that verify security middleware is registered for all REST routes
  • Code review searches for controllers or sensitive methods lacking authentication and authorization annotations
  • Integration tests that send unauthenticated requests to every protected endpoint and expect denial
  • API inventory reviews comparing exposed routes with authentication and privilege policies
  • Monitoring for anonymous access to user-management, credential, and administrative endpoints
  • Policy enforcement that blocks deployments when protected routes lack a recognized security middleware

Automated security review tools may help detect missing middleware registration, exposed administrative routes, and hard-coded credential handling.

Organizations can identify similar weaknesses through:

  • Static analysis and framework checks that verify security middleware is registered for all REST routes
  • Code review searches for controllers or sensitive methods lacking authentication and authorization annotations
  • Integration tests that send unauthenticated requests to every protected endpoint and expect denial
  • API inventory reviews comparing exposed routes with authentication and privilege policies
  • Monitoring for anonymous access to user-management, credential, and administrative endpoints
  • Policy enforcement that blocks deployments when protected routes lack a recognized security middleware

Automated security review tools may help detect missing middleware registration, exposed administrative routes, and hard-coded credential handling.

Sources

SourceLink
github.comgithub.com/LangChat/langchat/blob/2a6285a6b8c51d51cdc599771bb667a30bc03f5c/langchat-auth/src/main/java/cn/langchat/auth/controller/AigcUserController.java#L25-L60
github.comgithub.com/LangChat/langchat/blob/2a6285a6b8c51d51cdc599771bb667a30bc03f5c/langchat-auth/src/main/java/cn/langchat/auth/service/impl/AuthServiceImpl.java#L51-L58
github.comgithub.com/LangChat/langchat/blob/2a6285a6b8c51d51cdc599771bb667a30bc03f5c/langchat-server/src/main/java/cn/langchat/server/config/WebAsyncConfig.java#L17-L33
hackmd.iohackmd.io/@hieuPenguinnn/langchat-missing-global-auth-credential-exposure
vulncheck.comvulncheck.com/advisories/langchat-through-commit-2a6285a-missing-authentication-on-rest-api-controllers

Frequently asked

questions

Yes. If the affected REST endpoints are network reachable, an attacker may

interact with them without first authenticating.

No. The reported condition is a missing authentication control, so access to

the reachable API surface may be sufficient.

Require centralized authentication and authorization for every sensitive

controller, use deny-by-default behavior, and apply explicit privilege checks

to administrative operations.

Maintain an inventory of protected routes, test anonymous access in CI and

integration environments, avoid plaintext credential storage, and enforce

security middleware registration through code review and deployment policy.

Yes. If the affected REST endpoints are network reachable, an attacker may

interact with them without first authenticating.

No. The reported condition is a missing authentication control, so access to

the reachable API surface may be sufficient.

Require centralized authentication and authorization for every sensitive

controller, use deny-by-default behavior, and apply explicit privilege checks

to administrative operations.

Maintain an inventory of protected routes, test anonymous access in CI and

integration environments, avoid plaintext credential storage, and enforce

security middleware registration through code review and deployment policy.

Find out what's already
exploitable in your codebase.