CVE-2021-31856
published 2021-04-28CVE-2021-31856: A SQL Injection vulnerability in the REST API in Layer5 Meshery 0.5.2 allows an attacker to execute arbitrary SQL commands via the /experimental/patternfiles…
PriorityP180critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
75.38%
99.5th percentile
A SQL Injection vulnerability in the REST API in Layer5 Meshery 0.5.2 allows an attacker to execute arbitrary SQL commands via the /experimental/patternfiles endpoint (order parameter in GetMesheryPatterns in models/meshery_pattern_persister.go).
Affected
1 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| layer5 | meshery | — | — |
Detection & IOCsextracted from sources · hover to see the quote
- →Detect SQL injection attempts against the Meshery pattern files endpoint by monitoring GET requests to /api/experimental/patternfile with an `order` parameter containing SQL metacharacters (e.g., semicolons, SQL function calls such as `select`, `md5`). ↗
- →A successful blind/time-based or error-based SQL injection probe can be confirmed by checking if the HTTP 200 response body contains the MD5 hash of a known injected numeric value, indicating arbitrary SQL execution. ↗
- →The vulnerable code path is in `GetMesheryPatterns` within `models/meshery_pattern_persister.go`; focus code review and runtime monitoring on unsanitized use of the `order` query parameter in SQL queries. ↗
- ·The vulnerability is unauthenticated (PR:N) and network-reachable (AV:N), meaning no credentials are required to exploit the SQL injection via the REST API endpoint. ↗
- ·The Nuclei template uses a numeric canary value (`num: "999999999"`) injected via `select(md5(...))` to confirm exploitation; defenders should tune WAF/IDS rules to catch URL-encoded semicolons (`%3B`) followed by SQL function calls in the `order` parameter. ↗
CVSS provenance
nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.5HIGHAV:N/AC:L/Au:N/C:P/I:P/A:P
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
No detection rules found.
Nuclei
Layer5 Meshery 0.5.2 - SQL Injection
nuclei·CVSS 9.8
CVE-2021-31856 [CRITICAL] Layer5 Meshery 0.5.2 - SQL Injection
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).
Template:
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 querie
2021-04-28
Published