Description
Sourcegraph is a code intelligence platform. In versions prior to 4.1.0 a command Injection vulnerability existed in the gitserver service, present in all Sourcegraph deployments. This vulnerability was caused by a lack of input validation on the host parameter of the `/list-gitolite` endpoint. It was possible to send a crafted request to gitserver that would execute commands inside the container. Successful exploitation requires the ability to send local requests to gitserver. The issue is patched in version 4.1.0.
Affected Software
Related
{"id": "CVE-2022-41942", "vendorId": null, "type": "cve", "bulletinFamily": "NVD", "title": "CVE-2022-41942", "description": "Sourcegraph is a code intelligence platform. In versions prior to 4.1.0 a command Injection vulnerability existed in the gitserver service, present in all Sourcegraph deployments. This vulnerability was caused by a lack of input validation on the host parameter of the `/list-gitolite` endpoint. It was possible to send a crafted request to gitserver that would execute commands inside the container. Successful exploitation requires the ability to send local requests to gitserver. The issue is patched in version 4.1.0.", "published": "2022-11-22T19:15:00", "modified": "2022-11-26T03:30:00", "cvss": {"score": 0.0, "vector": "NONE"}, "cvss2": {}, "cvss3": {"cvssV3": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH", "baseScore": 7.8, "baseSeverity": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}, "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2022-41942", "reporter": "security-advisories@github.com", "references": ["https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-pfm3-23mh-6xjp", "https://github.com/sourcegraph/sourcegraph/pull/42553"], "cvelist": ["CVE-2022-41942"], "immutableFields": [], "lastseen": "2023-02-09T14:44:58", "viewCount": 17, "enchantments": {"score": {"value": 3.8, "vector": "NONE"}, "twitter": {"counter": 6, "tweets": [{"link": "https://twitter.com/VulmonFeeds/status/1595171997000298496", "text": "CVE-2022-41942\n\nSourcegraph is a code intelligence platform. In versions prior to 4.1.0 ...\n\nhttps://t.co/P0o8vNRNyp\n\nVulnerability Notification: https://t.co/xhLrNng6hm", "author": "VulmonFeeds", "author_photo": "https://pbs.twimg.com/profile_images/945758793161498625/67b3PEYK_400x400.jpg"}, {"link": "https://twitter.com/WolfgangSesin/status/1595168067721564167", "text": "New post from https://t.co/uXvPWJy6tj (CVE-2022-41942) has been published on https://t.co/n0MFjQlvY4", "author": "WolfgangSesin", "author_photo": "https://pbs.twimg.com/profile_images/957011635369054208/Om3jbj7z_400x400.jpg"}, {"link": "https://twitter.com/www_sesin_at/status/1595168069952933907", "text": "New post from https://t.co/9KYxtdZjkl (CVE-2022-41942) has been published on https://t.co/thgyg2IqT6", "author": "www_sesin_at", "author_photo": "https://pbs.twimg.com/profile_images/958100963822329858/fb_N8h5n_400x400.jpg"}]}, "affected_software": {"major_version": [{"name": "sourcegraph", "version": 4}]}, "dependencies": {"references": [{"type": "veracode", "idList": ["VERACODE:38228"]}]}, "epss": [{"cve": "CVE-2022-41942", "epss": "0.000430000", "percentile": "0.074910000", "modified": "2023-03-20"}], "vulnersScore": 3.8}, "_state": {"dependencies": 1675961342, "score": 1675961811, "twitter": 0, "affected_software_major_version": 1677380494, "epss": 1679352629}, "_internal": {"score_hash": "175d3e31fcc1b3f241866cc016c62f71"}, "cna_cvss": {"cna": "GitHub, Inc.", "cvss": {"3": {"vector": "CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L", "score": 7.9}}}, "cpe": [], "cpe23": [], "cwe": ["CWE-78", "CWE-20"], "affectedSoftware": [{"cpeName": "sourcegraph:sourcegraph", "version": "4.1.0", "operator": "lt", "name": "sourcegraph"}], "affectedConfiguration": [], "cpeConfiguration": {"CVE_data_version": "4.0", "nodes": [{"operator": "OR", "children": [], "cpe_match": [{"vulnerable": true, "cpe23Uri": "cpe:2.3:a:sourcegraph:sourcegraph:4.1.0:*:*:*:*:*:*:*", "versionEndExcluding": "4.1.0", "cpe_name": []}]}]}, "extraReferences": [{"url": "https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-pfm3-23mh-6xjp", "name": "https://github.com/sourcegraph/sourcegraph/security/advisories/GHSA-pfm3-23mh-6xjp", "refsource": "CONFIRM", "tags": ["Third Party Advisory"]}, {"url": "https://github.com/sourcegraph/sourcegraph/pull/42553", "name": "https://github.com/sourcegraph/sourcegraph/pull/42553", "refsource": "MISC", "tags": ["Patch", "Third Party Advisory"]}], "product_info": [{"vendor": "sourcegraph", "product": "sourcegraph"}]}
{"veracode": [{"lastseen": "2023-03-18T18:36:57", "description": "github.com/sourcegraph/sourcegraph is vulnerable to command injection. The vulnerability exist in the `listRepos` function in `list_gitolite.go` due to lack of input validation on the host parameter where the attacker uses a crafted request to execute commands inside the container.\n", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2022-11-24T08:06:59", "type": "veracode", "title": "Command Injection", "bulletinFamily": "software", "cvss2": {}, "cvelist": ["CVE-2022-41942"], "modified": "2023-03-17T11:06:49", "id": "VERACODE:38228", "href": "https://sca.analysiscenter.veracode.com/vulnerability-database/security/1/1/sid-38228/summary", "cvss": {"score": 0.0, "vector": "NONE"}}]}