CVE-2020-12283: Github.com/sourcegraph/sourcegraph Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-mx43-r985-5h4m
CVSS 6.1
CWE-601
Published
Advisory Summary

CVE-2020-12283 is a MODERATE (CVSS 6.1) remote code execution vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/sourcegraph/sourcegraph libraries in the Go ecosystem. The issue involves open redirect vulnerability in sourcegraph. Remediation is available by upgrading affected packages to version 3.14.4, 3.15.1.

CVE-2020-12283 at a Glance

CVE Identifier CVE-2020-12283
GHSA Identifier GHSA-mx43-r985-5h4m
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/sourcegraph/sourcegraph
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2020-12283

To remediate this vulnerability, upgrade all affected Github.com/sourcegraph/sourcegraph dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/sourcegraph/sourcegraph fixed: 3.14.4
Upgrade github.com/sourcegraph/sourcegraph to 3.14.4
github.com/sourcegraph/sourcegraph fixed: 3.15.1
Upgrade github.com/sourcegraph/sourcegraph to 3.15.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/sourcegraph/sourcegraph

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-12283, inspect your project dependencies for Github.com/sourcegraph/sourcegraph:

inspect dependencies for github.com/sourcegraph/sourcegraph

Analyze the terminal output to locate any version of Github.com/sourcegraph/sourcegraph in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.14.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/sourcegraph/sourcegraph, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact An open redirect vulnerability that allows users to be targeted for phishing attacks has been found in Sourcegraph instances configured with OAuth, OpenID, or SAML authentication enabled. Users targeted by these phishing attacks could have their authentication tokens silently harvested by an attacker. ### Specific Go Packages Affected github.com/sourcegraph/sourcegraph/cmd/frontend/auth ### Resolution Sourcegraph v3.14.4 and v3.15.1 have been released which resolve the vulnerability. ([associated change](https://github.com/sourcegraph/sourcegraph/pull/10167)) ### Workarounds Disabling OAuth, OpenID and/or SAML sign-in options until upgraded to the patched versions will secure Sourcegraph / workaround the issue. ### Timeline - Apr 23, 8 AM PST: GitHub Security Lab reported the issue to Sourcegraph. - Apr 23, 11 PM PST: A Sourcegraph engineer proposed a resolution for the vulnerability. https://github.com/sourcegraph/sourcegraph/pull/10167 - Apr 24, 3 AM PST: The proposed resolution was reviewed, approved, and merged. - Apr 28, 2 PM PST: Patch releases for 3.14.4 and 3.15.1 were published. - Apr 29, 10 PM PST: Mitre publicly disclosed [CVE-2020-12283](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12283). - Apr 30, 11 AM PST: Sourcegraph issued a GitHub security advisory and notified all affected users. ### References - [Mitre: CVE-2020-12283](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12283) - [GitHub Security Lab: GHSL-2020-085](https://securitylab.github.com/advisories/GHSL-2020-085-sourcegraph) - [detectify's blog post on open redirect vulnerabilities ](https://blog.detectify.com/2019/05/16/the-real-impact-of-an-open-redirect/) ### For more information If you have any questions or comments about this advisory, please contact us at [support@sourcegraph.com](mailto:support@sourcegraph.com) and include `CVE-2020-12283` in the title.

CVE-2020-12283 Affected Github.com/sourcegraph/sourcegraph Versions

2 component(s)
Fixed Versions:
3.14.43.15.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/sourcegraph/sourcegraph
Go
< 3.14.4
3.14.4
github.com/sourcegraph/sourcegraph
Go
≥ 3.15.0
< 3.15.1
3.15.1

References

Frequently Asked Questions

What is CVE-2020-12283?
CVE-2020-12283 is a security vulnerability in Github.com/sourcegraph/sourcegraph involving Open redirect vulnerability in Sourcegraph under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/sourcegraph/sourcegraph versions are affected?
Affected versions include releases prior to 3.14.4, 3.15.1 across affected packages: github.com/sourcegraph/sourcegraph.
What version fixes CVE-2020-12283?
Upgrading to 3.14.4, 3.15.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/sourcegraph/sourcegraph affected?
Yes, github.com/sourcegraph/sourcegraph is affected in releases prior to 3.14.4, 3.15.1. Upgrade your dependency to 3.14.4, 3.15.1 or later.
What is the CVSS score of CVE-2020-12283?
CVE-2020-12283 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2020-12283?
CVE-2020-12283 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for CVE-2020-12283?
Run the dependency tree command: 'inspect dependencies for github.com/sourcegraph/sourcegraph'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mx43-r985-5h4m",
  "modified" : "2023-10-02T14:32:06Z",
  "published" : "2021-12-20T18:12:47Z",
  "aliases" : [ "CVE-2020-12283" ],
  "summary" : "Open redirect vulnerability in Sourcegraph",
  "details" : "### Impact\n\nAn open redirect vulnerability that allows users to be targeted for phishing attacks has been found in Sourcegraph instances configured with OAuth, OpenID, or SAML authentication enabled. Users targeted by these phishing attacks could have their authentication tokens silently harvested by an attacker.\n\n### Specific Go Packages Affected\ngithub.com/sourcegraph/sourcegraph/cmd/frontend/auth\n\n### Resolution\n\nSourcegraph v3.14.4 and v3.15.1 have been released which resolve the vulnerability. ([associated change](https://github.com/sourcegraph/sourcegraph/pull/10167))\n\n### Workarounds\n\nDisabling OAuth, OpenID and/or SAML sign-in options until upgraded to the patched versions will secure Sourcegraph / workaround the issue.\n\n### Timeline\n\n- Apr 23, 8 AM PST: GitHub Security Lab reported the issue to Sourcegraph.\n- Apr 23, 11 PM PST: A Sourcegraph engineer proposed a resolution for the vulnerability. https://github.com/sourcegraph/sourcegraph/pull/10167\n- Apr 24, 3 AM PST: The proposed resolution was reviewed, approved, and merged.\n- Apr 28, 2 PM PST: Patch releases for 3.14.4 and 3.15.1 were published.\n- Apr 29, 10 PM PST: Mitre publicly disclosed [CVE-2020-12283](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12283).\n- Apr 30, 11 AM PST: Sourcegraph issued a GitHub security advisory and notified all affected users.\n\n### References\n\n- [Mitre: CVE-2020-12283](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12283)\n- [GitHub Security Lab: GHSL-2020-085](https://securitylab.github.com/advisories/GHSL-2020-085-sourcegraph)\n- [detectify's blog post on open redirect vulnerabilities\n](https://blog.detectify.com/2019/05/16/the-real-impact-of-an-open-redirect/)\n\n### For more information\n\nIf you have any questions or comments about this advisory, please contact us at [support@sourcegraph.com](mailto:support@sourcegraph.com) and include `CVE-2020-12283` in the title.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sourcegraph/sourcegraph"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.14.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/sourcegraph/sourcegraph"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.15.0"
      }, {
        "fixed" : "3.15.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-mx43-r985-5h4m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-12283"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sourcegraph/sourcegraph/pull/10167"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sourcegraph/sourcegraph/commit/c0f48172e815c7f66471a38f0a06d1fc32a77a64"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sourcegraph/sourcegraph"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sourcegraph/sourcegraph/blob/master/CHANGELOG.md"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sourcegraph/sourcegraph/compare/v3.15.0...v3.15.1"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2020-085-sourcegraph"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-24T21:06:22Z",
    "nvd_published_at" : null
  }
}