Summary
Atlantis does not properly authenticate requests to its GitHub App setup endpoint, allowing an unauthenticated attacker to access sensitive application credentials. If an attacker can observe or intercept the GitHub redirect during setup, they may obtain the RSA private key and webhook secret, enabling installation-token minting and webhook-payload forgery.
Affected context
The vulnerability occurs in Atlantis deployments that expose the GitHub App setup workflow through an unauthenticated endpoint. Risk increases when setup redirects can be observed or intercepted and when the resulting RSA private key or webhook secret is trusted for GitHub API authentication and webhook verification.
Exploit preconditions
- Attack surface: The Atlantis
/github-app/setupendpoint and its GitHub redirect flow - Required access: No prior Atlantis authentication is required
- Trigger point: A GitHub App setup request and associated redirect exchange
- Why exploitation is possible: The endpoint does not adequately verify the requester's identity before exposing setup-related credential material
- Additional condition: The attacker must be able to observe or intercept the relevant redirect or otherwise access the exposed credentials
Why this happens
The underlying issue is a missing authentication control on a sensitive setup endpoint. The application permits unauthenticated interaction with a workflow that can disclose credentials used to authenticate GitHub App operations and validate webhook requests. This maps to CWE-306: Missing Authentication for Critical Function, because a security-sensitive function is reachable without first establishing that the requester is authorized.
Potential impact
- An attacker may obtain the GitHub App RSA private key
- An attacker may obtain the webhook secret
- Attackers could mint GitHub installation tokens
- Attackers could forge webhook payloads accepted as authentic
- Repository automation and infrastructure workflows may be manipulated
- Confidential repository or organization data may be exposed through abused integration privileges
General mitigation guidance
Mitigation generally focuses on requiring strong authentication and authorization before any GitHub App setup material is exposed.
Common defensive patterns include:
- Protecting setup and credential-management endpoints with administrator authentication and explicit authorization
- Separating one-time enrollment workflows from routine application operations
- Using short-lived, narrowly scoped enrollment capabilities where an unauthenticated bootstrap is unavoidable
- Keeping private keys and webhook secrets in dedicated secret-management systems rather than returning them through browser-visible flows
- Restricting redirect destinations, enforcing transport security, and reducing opportunities for redirect interception
- Applying least privilege to GitHub App permissions and Atlantis service accounts
- Rotating exposed credentials and invalidating previously issued tokens when compromise is suspected
How teams detect issues like this
Organizations can detect this class of issue through:
- Static analysis and API security rules that flag sensitive endpoints without authentication middleware
- Code review checks for credential generation, export, or setup handlers reachable before identity verification
- Route inventory reviews comparing administrative functions with enforced authentication and authorization policies
- Web-application monitoring for anonymous requests to setup endpoints and unusual GitHub token issuance
- Alerts for webhook validation failures, unexpected GitHub App activity, or access from unfamiliar networks
- Automated security testing that exercises sensitive routes with missing, invalid, and insufficient credentials

