praisonai
Affected
- introduced
1.5.1, fixed1.7.2(semver)
Fixed versions
1.7.2
Fix
- Fixed version
1.7.2npm install [email protected]
Advisory
Also known as: CVE-2026-57134
npm PraisonAI MCPSecurity Basic/OAuth authentication policies accept invalid credentials without validation
Summary
The published npm package praisonai exports an MCPSecurity helper described in source as:
MCP Security - Authentication, authorization, and rate limiting
Provides security policies for MCP servers.
Its AuthMethod type advertises five authentication methods:
export type AuthMethod = 'none' | 'api-key' | 'bearer' | 'basic' | 'oauth';
The authentication-policy evaluator, however, only validates credentials for api-key and bearer:
if (policy.auth.method === 'api-key' || policy.auth.method === 'bearer') {
const valid = policy.auth.validate
? await policy.auth.validate(token)
: this.validateApiKey(token);
if (!valid) {
return { allowed: false, reason: 'Invalid credentials' };
}
}
return { allowed: true, context: { authenticated: true } };
For basic and oauth, any non-empty Authorization header skips the supplied validate callback and returns allowed. A local PoV configures auth.validate to always return false; invalid api-key and bearer credentials are rejected, while invalid basic and oauth credentials are accepted without calling the validator.
This is a protection-mechanism failure in the exported npm MCP security helper. It is distinct from the separate issue that the npm MCPServer HTTP transport does not enforce authentication by default.
Technical Details
SecurityPolicy.auth accepts both a method and a validator:
auth?: { method: AuthMethod; validate?: (token: string) => Promise<boolean> };
extractToken() parses both Bearer and Basic headers:
if (auth.startsWith('Bearer ')) {
return auth.slice(7);
}
if (auth.startsWith('Basic ')) {
return auth.slice(6);
}
return auth;
But evaluatePolicy() only calls policy.auth.validate() for two methods:
if (policy.auth.method === 'api-key' || policy.auth.method === 'bearer') {
const valid = policy.auth.validate
? await policy.auth.validate(token)
: this.validateApiKey(token);
if (!valid) {
return { allowed: false, reason: 'Invalid credentials' };
}
}
There is no validation branch for basic or oauth. After extracting any non-empty token, those methods fall through to the success return:
return { allowed: true, context: { authenticated: true } };
check() then ignores successful authentication context and returns a generic allowed result:
return { allowed: true, context: { authenticated: false } };
That context propagation issue is secondary. The security-relevant flaw is that invalid Basic/OAuth credentials are allowed at all.
Why This Is Not Intended Behavior
This is not a claim that every MCPSecurity user must choose Basic or OAuth. The issue is that the API explicitly exposes those methods as authentication methods and accepts a validator callback for the policy, but the implementation does not call the validator for those methods.
The control cases prove the intended security behavior:
Authentication required.api-key credentials are denied as Invalid credentials.bearer credentials are denied as Invalid credentials.The only difference in the vulnerable cases is the selected advertised method. Invalid Basic/OAuth credentials should not become authenticated merely because the method is not listed in the two-method validation branch.
This also matches MCP authorization guidance. MCP servers acting as resource servers must validate received access tokens; receiving a token is not proof that it is valid or intended for the server.
PoV
Run from a local reproduction checkout:
node poc/pov_poc.js 1.7.1
The PoV:
npm:[email protected] into a temporary project with scripts disabled.MCPSecurity from the package root.authenticate policy per method.auth.validate callback that always returns false.api-key, bearer, basic, and oauth credentials.Observed output summary from evidence/pov-npm-1.7.1.json:
{
"package": "praisonai",
"version": "1.7.1",
"cases": [
{
"method": "api-key",
"validateCalls": 1,
"allowed": false,
"reason": "Invalid credentials"
},
{
"method": "bearer",
"validateCalls": 1,
"allowed": false,
"reason": "Invalid credentials"
},
{
"method": "basic",
"validateCalls": 0,
"allowed": true
},
{
"method": "oauth",
"validateCalls": 0,
"allowed": true
},
{
"method": "basic",
"authorizationHeaderPresent": false,
"validateCalls": 0,
"allowed": false,
"reason": "Authentication required"
}
],
"controlsPass": true,
"vulnerable": true
}
The PoV is local-only. It does not start a server, contact a third-party target, or use live credentials.
PoC
The PoV section above contains the local reproduction command, input, and decisive output.
Impact
A downstream application that uses MCPSecurity to protect an HTTP MCP transport, gateway, or equivalent tool/resource endpoint can believe it has enabled Basic or OAuth authentication while accepting any non-empty Authorization header.
Depending on the protected MCP tools and resources, this can allow an unauthenticated network caller to:
This report does not claim that npm PraisonAI wires MCPSecurity into the default MCPServer.startHttp() path. It is a library-level authentication bypass in an exported security component intended to protect MCP servers.
Severity
Suggested severity: High.
Rationale:
AV: the affected helper is intended to protect MCP server requests and equivalent HTTP security checks.AC: a single non-empty Basic or OAuth-style Authorization header is sufficient when such a policy is configured.PR: the bypass grants access without valid credentials.UI: no maintainer or user interaction is required after deployment.S: impact is within the PraisonAI-hosting service and its exposed MCP resources/tools.C: protected MCP resources or tool outputs may be disclosed.I: protected tool calls may perform state-changing actions depending on the registered tools; the score is conservative because the vulnerable helper is library-level and deployment-dependent.A: the PoV does not demonstrate availability impact.If a deployment protects high-impact write or execution tools with MCPSecurity, maintainers may reasonably score integrity higher.
Suggested Fix
Make authentication evaluation fail closed for every advertised method.
High Basis: The source's own band: HIGH
1.5.1, fixed 1.7.2 (semver)1.7.2
1.7.2npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0