GitLab AI Gateway CVE-2026-90970 Patch Tutorial
GitLab fixed critical CVE-2026-90970 in its self-hosted AI Gateway. Learn how to identify affected versions, upgrade the gateway, verify the fix, and harden its network access.
On this page
GitLab disclosed CVE-2026-90970 on October 2, 2026, after fixing a critical flaw in its self-hosted AI Gateway. Under certain conditions, an authenticated user with Duo Agent Platform access could escape the prompt-template sandbox through a crafted flow configuration and execute arbitrary commands on the gateway. GitLab rates the vulnerability 9.9 on the Common Vulnerability Scoring System (CVSS), and the affected gateway releases are fixed in 19.2.4, 19.3.2, and 19.4.1.
First determine whether your AI Gateway is actually affected
The first mistake to avoid is checking only the version of the main GitLab application. The vulnerable component is the GitLab AI Gateway, a separate service that connects GitLab Duo features with AI processing, and a self-managed GitLab installation can use either a GitLab-hosted gateway or its own self-hosted gateway. GitLab says the fix has already been deployed to GitLab-hosted AI Gateways, so customers using GitLab.com, GitLab Dedicated, or a self-managed installation configured to use the GitLab-hosted gateway do not need to perform this gateway upgrade. The administrator action in this tutorial applies to organizations that actually operate their own Self-Hosted AI Gateway.
GitLab identifies three affected version ranges: versions from 18.1.6 up to but not including 19.2.4, versions in the 19.3 series before 19.3.2, and versions in the 19.4 series before 19.4.1. The corrected releases are 19.2.4, 19.3.2, and 19.4.1 or later. If your gateway is outside those affected ranges, do not infer vulnerability from the CVE alone; verify the installed gateway version against the vendor's current release guidance.
Understand what CVE-2026-90970 actually allows
The flaw is classified as CWE-1336, which covers improper neutralization of special elements used in a template engine. In practical terms, the security boundary being attacked is the prompt-template sandbox used by the AI Gateway. GitLab says an authenticated user who has Duo Agent Platform access could use a specially crafted flow configuration to escape that sandbox and reach arbitrary command execution on the gateway. The CVSS vector records network reachability, low attack complexity, low privileges required, no user interaction, changed scope, and high confidentiality, integrity, and availability impact.
That distinction matters when assessing exposure. This is not described by GitLab as an unauthenticated attacker simply sending a request to an internet-facing gateway and immediately gaining command execution; the documented scenario requires authentication and Duo Agent Platform access. At the same time, the resulting command-execution capability is serious because the gateway is a server-side component connected to the GitLab environment and potentially to configured AI model providers. GitLab has not published a detailed exploit recipe in the advisory, so administrators should patch from the vendor's fixed releases rather than trying to reproduce the sandbox escape in production.
Check the gateway image before replacing it
GitLab distributes the self-hosted AI Gateway as a container image and also supports Kubernetes deployment. The installation documentation recommends using a stable versioned image rather than a nightly build, and it ties the gateway image tag to the GitLab version used by the installation. This is important for remediation because replacing an image with an unrelated version can introduce compatibility problems even when the version number looks newer.
For a Docker deployment, inspect the running containers first so you know which gateway image is currently active. A command such as the following lists the image and container information without changing the service:
docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}" Look for the container running the AI Gateway and record its image tag before stopping anything. If your organization uses Kubernetes instead, inspect the deployed image tag and namespace through your normal cluster administration process. The goal is to establish a before-and-after record so you can prove which gateway release was replaced rather than relying on a successful container restart as evidence of remediation.
Stop the old Docker gateway cleanly
GitLab's Docker upgrade procedure is deliberately simple: stop the existing gateway container, remove that container, pull the newer image, and start it again with the required environment variables. Stopping the container does not mean deleting the configuration files or signing keys that the service depends on. Keep those credentials protected because the gateway uses RSA 2048-bit private keys for its self-issued JSON Web Token authentication.
sudo docker stop gitlab-aigw sudo docker rm gitlab-aigw If your container has a different name, substitute the actual name shown by the inventory command. Do not remove persistent configuration or secret material simply because the container is being replaced. GitLab's installation documentation treats the image as the replaceable component while the environment variables and signing keys remain part of the service configuration.
Pull the corrected AI Gateway release
Choose the corrected release that matches your supported GitLab branch. For the CVE itself, GitLab lists 19.2.4, 19.3.2, and 19.4.1 as the fixed releases, with later versions also outside the affected ranges. The exact image tag used by your deployment should follow GitLab's self-hosted AI Gateway release convention rather than being copied from an unrelated example.
docker pull registry.gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/model-gateway: After the pull completes, compare the downloaded image with the version you recorded before the upgrade. GitLab also documents image-digest verification for Docker deployments, which gives you a stronger check than a mutable tag alone. For production environments, an immutable digest can prevent a later image change from silently altering what gets deployed.
docker images --digests | grep ai-assist Start the gateway with the existing security configuration
The gateway needs its GitLab instance address, GitLab API address, and the signing and validation keys used for authentication. The current installation documentation also uses separate key pairs for the AI Gateway and the GitLab Duo Agent Platform service. Do not generate new keys simply because you are upgrading the container unless your key-management procedure requires rotation; changing authentication material unnecessarily can turn a security patch into an avoidable configuration outage.
docker run -d \ -p 5052:5052 \ -p 50052:50052 \ -e AIGW_GITLAB_URL= \ -e AIGW_GITLAB_API_URL= \ -e AIGW_SELF_SIGNED_JWT__SIGNING_KEY="$(cat aigw_signing.key)" \ -e AIGW_SELF_SIGNED_JWT__VALIDATION_KEY="$(cat aigw_validation.key)" \ -e DUO_WORKFLOW_AUTH__ENABLED="true" \ -e DUO_WORKFLOW_SELF_SIGNED_JWT__SIGNING_KEY="$(cat duo_workflow_jwt.key)" \ -e DUO_WORKFLOW_SELF_SIGNED_JWT__VALIDATION_KEY="$(cat duo_workflow_validation.key)" \ registry.gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/model-gateway: Port 5052 handles the gateway's HTTP communication, while port 50052 is used by the GitLab Duo Agent Platform service. GitLab's documentation also requires a valid hostname accessible from the network rather than using localhost as the gateway's configured hostname. Keep the gateway behind the network controls appropriate for your deployment rather than exposing these service ports directly to the public internet.
Verify the gateway before reconnecting GitLab Duo
A container showing a running status is only the first check. GitLab documents that accessing the HTTP endpoint from the container host should return an authorization error when no authorization header is supplied; that response demonstrates that the service is responding rather than proving a successful authenticated integration. The more useful verification is to check the running image, inspect the gateway logs for startup failures, and then run GitLab's self-hosted Duo verification procedure.
docker ps --filter name=gitlab-aigw docker logs --tail 100 gitlab-aigw GitLab provides gitlab-rake gitlab:duo:verify_self_hosted_setup as a troubleshooting check for self-hosted Duo installations. The check can help identify an incorrect gateway URL, missing configuration, or authentication problem after the image replacement. Run it from the GitLab environment after the upgraded gateway is responding, rather than using application traffic alone as your health test.
sudo gitlab-rake gitlab:duo:verify_self_hosted_setup Check the GitLab Duo gateway setting after the upgrade
GitLab exposes the local gateway configuration from the administrator interface under the GitLab Duo settings. The administrator should verify that the Local AI Gateway URL still points to the upgraded service and that any configured GitLab Duo Agent Platform service endpoint remains correct. If the gateway uses a private address, GitLab may require that address to be added to the appropriate IP allowlist before requests are accepted.
For Kubernetes deployments, the same principle applies even though the replacement mechanism differs. GitLab's AI Gateway chart supports deploying the gateway alongside GitLab, and production configurations require TLS for the GitLab endpoint used for authentication. The chart documentation also describes using image tags and internal TLS settings, so a Kubernetes remediation should update the deployed image rather than treating the Docker procedure above as a literal command sequence.
Harden the gateway after patching
Applying the fixed release closes the vulnerable code path, but the gateway still deserves its own network boundary because it processes authenticated GitLab requests and communicates with configured model providers. GitLab recommends restricting outbound network access from the gateway container and allowing only the GitLab instance, configured model-provider endpoints, and the required licensing endpoint where applicable. This reduces the destinations available to a compromised gateway and is especially relevant for a service that can execute commands on its host environment.
Do not solve connectivity problems by allowing unrestricted outbound traffic. GitLab specifically recommends testing firewall rules in a non-production environment first because overly restrictive rules can break legitimate AI Gateway functions. If your environment uses an offline license, the required network behavior is different because the gateway can authenticate against the local GitLab instance instead of relying on the normal customer-licensing connection.
Record the remediation and watch for failed upgrade attempts
CVE-2026-90970 was published on October 2, 2026, and the National Vulnerability Database currently records GitLab's 9.9 CVSS assessment while noting that its own enrichment assessment is not yet available. Public tracking reviewed for this article did not establish confirmed exploitation or a CISA Known Exploited Vulnerabilities listing for this specific CVE, so those facts should not be turned into an assumption that the flaw is harmless. The practical response is to establish whether a self-hosted gateway is affected, apply the vendor's corrected release, and preserve the evidence showing what version was deployed and when.
After the upgrade, keep the old image information, new image version or digest, deployment timestamp, verification output, and relevant gateway logs in the change record. If the gateway is independently exposed or has privileged access to other infrastructure, review authentication and network logs around the period when the vulnerable version was running. That turns the patch from a version change into a completed security response, while leaving you with evidence to revisit if GitLab later publishes additional technical details about the vulnerability.
Share this post



