Summary
Lightdash can send an organization's GitLab app token to a host that has not been verified when its AI agent reads a repository. A project developer who can set the dbt connection host_domain to an attacker-controlled server may capture the token and use it to access reachable repositories.
Affected context
The issue concerns Lightdash's GitLab repository-read access flow. It becomes risky when a project developer can configure the dbt connection's host_domain and the AI agent subsequently reads the repository, causing the organization's GitLab app token to be sent to a host that has not been verified.
Exploit preconditions
- Attack surface: GitLab repository access initiated by Lightdash's AI agent
- Required access: Ability to set or influence a project's dbt connection
host_domain - Trigger point: The AI agent reads the repository using the configured host
- Why exploitation is possible: The credential is sent without adequately verifying that the destination host is trusted
Why this happens
The GitLab access flow does not sufficiently protect credentials when selecting the destination for a repository request. Sending an organization app token to an unverified host can disclose that secret to an attacker-controlled endpoint. This maps to CWE-522: Insufficiently Protected Credentials.
Potential impact
- An attacker may capture the organization's GitLab app token.
- The captured token could allow access to repositories reachable with that credential.
- Exposed repository contents could increase the risk of further compromise or disclosure.
General mitigation guidance
Defensive patterns focus on ensuring credentials are only sent to trusted destinations and limiting the harm if a credential is exposed.
- Bind repository access to verified, explicitly allowed GitLab hosts.
- Avoid deriving credential destinations from project-controlled connection values.
- Keep tokens scoped to the minimum repositories and permissions needed.
- Store and handle credentials through protected secret-management mechanisms, and avoid exposing them to untrusted project configuration.
- Consider controls for detecting and responding to unexpected credential use.
How teams detect issues like this
- Review code paths that attach GitLab tokens to requests and verify how destination hosts are selected and validated.
- Use static analysis or code review checks to flag secrets sent to URLs influenced by project-controlled configuration.
- Apply policy checks that restrict repository integrations to approved hostnames.
- Monitor for GitLab token use from unexpected hosts or access patterns.

