SourcegraphApplication

CVE-2022-29171

HIGH · 7.2 CVSS v3.1 Published 2022-05-06
Fix available
A fix is available. Upgrade to 3.38.0 or later.
See remediation →
78/100
Remediation priority · High
Remotely reachable Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Sourcegraph is a fast and featureful code search and navigation engine. Versions before 3.38.0 are vulnerable to Remote Code Execution in the gitserver service. The Gitolite code host integration with Phabricator allows Sourcegraph site admins to specify a `callsignCommand`, which is used to obtain the Phabricator metadata for a Gitolite repository. An administrator who is able to edit or add a Gitolite code host and has administrative access to Sourcegraph’s bundled Grafana instance can change this command arbitrarily and run it remotely. This grants direct access to the infrastructure underlying the Sourcegraph installation. The attack requires: site-admin privileges on the instance of Sourcegraph, Administrative privileges on the bundled Grafana monitoring instance, Knowledge of the gitserver IP address or DNS name (if running in Kubernetes). This can be found through Grafana. The issue is patched in version 3.38.0. You may disable Gitolite code hosts. We still highly encourage upgrading regardless of workarounds.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Sourcegraph versions before 3.38.0 contain an RCE vulnerability in the gitserver service via the Gitolite-Phabricator integration. Attackers with both site-admin privileges and Grafana administrative access can modify the callsignCommand configuration to execute arbitrary commands on the underlying gitserver infrastructure.

MitigationUpgrade to Sourcegraph 3.38.0 or later, or disable Gitolite code host integrations entirely to eliminate the attack surface.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
SourcegraphApplication
Affected:< 3.38.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed Sourcegraph version
    Access the Sourcegraph site administration panel or check the version via the site-config API endpoint /site-config. Alternatively, check the Docker container or deployment manifest for the version tag.
    Affected if The installed version is any version before 3.38.0 (e.g., 3.37.x, 3.36.x, etc.)
  2. Verify if Gitolite code host integration is enabled
    In Sourcegraph site administration, navigate to the code hosts or gitserver settings. Look for any configured Gitolite or Phabricator integrations.
    Affected if Gitolite code host integration is actively configured or connected in the Sourcegraph instance
  3. Confirm Grafana administrative access exists
    Check if Grafana is exposed and accessible. Verify whether site-admin users also have Grafana admin privileges, or check if separate Grafana admin credentials exist.
    Affected if A user possesses both Sourcegraph site-admin rights and Grafana administrative access
  4. Inspect callsignCommand configuration
    In the Sourcegraph site configuration or gitserver settings, locate the callsignCommand parameter. This is typically found under gitserver configuration or code host settings.
    Affected if The callsignCommand field is present and contains a non-empty value, or can be modified by administrative users

The environment is affected if Sourcegraph version is below 3.38.0 AND the Gitolite integration is enabled AND an attacker could obtain both site-admin and Grafana admin access to modify callsignCommand.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.38.0 or later
Fixed in 3.38.0
Interim mitigation

Upgrade to Sourcegraph 3.38.0 or later, or disable Gitolite code host integrations entirely to eliminate the attack surface.

Recommended fix High confidence

3.38.0

  1. 1. Review the current Sourcegraph version by navigating to the site admin dashboard or checking the deployment configuration
  2. 2. Plan for downtime during the upgrade process - schedule a maintenance window
  3. 3. Back up the Sourcegraph database and configuration files before proceeding
  4. 4. For Kubernetes deployments: update the Sourcegraph deployment using your Helm chart or kubectl with the new version (e.g., kubectl set image deployment/sourcegraph sourcegraph=sourcegraph/server:3.38.0)
  5. 5. For Docker Compose deployments: update the docker-compose.yml file to use version 3.38.0 images and run docker-compose up -d
  6. 6. For single-container deployments: stop the current container and start a new one with the 3.38.0 image tag
  7. 7. Verify the upgrade was successful by checking the Sourcegraph version in the admin dashboard
  8. 8. Confirm the Gitolite code host integration is functioning correctly with the new version
Caveat Review Sourcegraph 3.38.0 release notes for any configuration or feature changes that may affect your deployment

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Sourcegraph Scoped from the published advisory
  • Consultation3.0 h
  • Implementation3.0 h
  • Testing3.0 h
  • Review / QA2.0 h
11.0 hours of engineering $1,950
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-29171 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-29171 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data