Summary
HarnessRouter can attach an internal service key to requests with an Authorization header before validating the bearer token, allowing certain service-only routes to accept requests that should not be authorized. In multi-organization deployments, a remote caller may use this behavior to change another organization's provider connection, potentially exposing prompts and influencing task responses.
Affected context
The issue concerns HarnessRouter deployments where the console is not in self-hosted mode and the service-only connection, policy, or internal routes are reachable. Risk is greatest in multi-organization environments because these routes trust the server's internal key and use the organization identifier supplied in the URL.
Exploit preconditions
- Attack surface: Reachability of the affected HarnessRouter API routes
- Required access: A remote caller able to send requests with an Authorization header; a valid bearer is not properly checked before the internal key is attached
- Trigger point: Requests to the service-only connection or policy routes, or to
/internal/* - Why exploitation is possible: The routes trust the attached internal key and derive the target organization from the URL, enabling unauthorized cross-organization changes in affected deployments
Why this happens
The authorization flow attaches a privileged internal key before validating the caller's bearer token. Downstream routes treat that key as sufficient authority and accept an organization identifier from the request URL without adequately checking that the caller is authorized for that organization. This reflects CWE-862: Missing Authorization and CWE-863: Incorrect Authorization: access controls are absent or incorrectly applied to sensitive operations.
Potential impact
- An attacker could rewrite another organization's provider connection to point to an attacker-controlled endpoint.
- Prompts sent through the altered connection may be disclosed to that endpoint.
- Attacker-controlled responses could influence tasks or agent behavior.
- Organization policy or internal operations could be exposed to unauthorized changes, depending on reachable routes.
General mitigation guidance
Defensive patterns include validating caller credentials before attaching or using any privileged internal identity, and checking authorization for each operation against the specific organization being accessed. Keep internal routes isolated from untrusted callers, avoid treating shared service keys as a substitute for user- and organization-level authorization, and apply least privilege to service identities. Where possible, reduce reliance on caller-controlled organization identifiers and use secure-by-default route and policy designs.
How teams detect issues like this
- Review authentication middleware to ensure bearer validation occurs before privileged credentials are attached or trusted.
- Use static analysis and code review to identify routes that rely solely on internal keys or accept organization identifiers from request paths without an authorization check.
- Test authorization policies across organization boundaries, including requests with invalid or missing credentials.
- Enforce API gateway or service policies that restrict access to internal and service-only routes and log denied or cross-organization access attempts.

