cns me / blog Cloudy with a Chance of Freefall
← Index | | 4 min read

Internal is not a patch plan

AI Generated: We all admired the wall, nobody enquired about the laptop.

Many companies use an on-premise GitLab for their development instead of GitHub. This is often configured behind a VPN or an IP allow list, with the assumption that communication can only occur from the inside. Consequently, updates to an on-premise installation are often delayed compared to the public website. This is a false sense of security: your employees’ browsers are on the inside. Malicious web content viewed by them can use their browser to communicate with your server.

A garden gate left slightly open with a cat looking through the gap
AI Generated: You never come in through the front door, you always wait for a door like this.

The browser is already inside

A malicious webpage can instruct a user’s browser to make requests to the internal GitLab. The browser would ordinarily block the webpage from accessing the response data via what’s called the same-origin policy. However, a server can allow cross-origin resource sharing (CORS) to bypass this restriction. GitLab does indeed enable CORS for its API by default. It’s intentional: the API tells the browser that any webpage is allowed to see the response data. This applies only to requests that are made without user cookies, so the webpage cannot see the data that’s available to the logged-in user, but it can see the data the API gives to an anonymous user.

As of Chrome 142, you’ll be prompted to allow public pages to access your private network. Clicking Allow will let the page through. Note that this is not a universal browser feature, and it won’t trigger for GitLab instances with a public IP address and IP allowlisting. It also won’t be triggered by malicious pages that are already on your network, such as a compromised wiki.

What a stranger's page can learn

I developed out of curiosity a scanner that demonstrates what can be gleaned about a GitLab instance from a malicious web page. It’s a purely client-side application that makes requests only against the specified GitLab instance. First, it tries to determine the version of GitLab you are running. Because GitLab’s fronend files carry a hash of their contents in the filename, every build has a unique fingerprint. The scanner includes 1,107 different frontend builds spanning from version 10.0.0 and up. Because a build may span multiple patch releases, sometimes you end up with a small version range.

Following this, the scanner displays all CVEs for that version and marks those that may be accessible from an unauthenticated web page, drawing on public advisories and reproductions (I haven’t tried to exploit any of them from the browesr). This tool is intended as a decision support system for prioritising patching. The ControlPlane open source scanner is available under the MIT licence.

The National Vulnerability Database shows 1,487 CVEs impacting GitLab 10.0.0 and above. The scanner finds 65 of these, 4 of which have a public reproduction showing a non-authenticated request that could be made from a web page. One of these is CVE-2025-2246, which was addressed by GitLab in August of 2025. Prior to the fix, an unauthenticated user could access a public project’s manual CI/CD variables via the GraphQL API, assuming they knew the project path. On an unpatched internal GitLab instance, a malicious web page loaded by a single employee could have accessed these variables, including any secrets they contained.

Patch it as if it faced the internet

For an internal GitLab, the relevant cosideration is how many monthly updates behind you are. GitLab releases a new version every month. In general, they only backport security fixes to the last 3 monthly updates. If you are on a release more than 3 months old, the only way to get security fixes is to update. Simply being within the 3 monthly updates isn’t sufficient; you also need to be on the most recent patch update, which comes around every other week or so. Many internal GitLabs are “pets”, meaning they run on a single server that is manually maintained and updated whenever someone feels brave enough.

Diagram of three supported release markers with one server stranded far behind on faded older ones
AI Generated: Fine until you realise that one little server has long left the party.

The solution is to start treating your internal GitLab as you would your public website: patch it urgently and make sure it’s on the latest patch level for one of the 3 supported releases. Then, you need to see whether anything, system or user, relies on the API being accessible from other origins. Because GitLab itself sends the wildcard CORS header, if nothing relies on this header you can remove it from your reverse proxy to prevent other sites from snooping on the API responses. Keep in mind, though, that a page can detect the GitLab version by checking for the presence of static files, so patching is still your primary control.

Lastly, run the scanner against your own GitLab instance to see what a malicious web page would see. Naturally, only run this against GitLab instances that you are allowed to evaluate. If you can help improve the corpus or the CVE mappings, feel free to submit a pull request.

(Views in this article are my own.)

🦩