CVE-2021-36686: Cross-site Scripting in yapi-vendor
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.50567%
CWE
Published
1/26/2023
Updated
3/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| yapi-vendor | npm | <= 1.9.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key points:
- The backend API handler for the interface edit endpoint (likely in a controller file) fails to sanitize user input in the 'remarks' field before storage, as evidenced by the stored XSS payloads persisting after saving.
- The markdown rendering utility (used in both preview and display modes) fails to sanitize HTML output, allowing execution of injected scripts. This is confirmed by payloads triggering XSS in both write/preview modes (Issue #2240) and when viewed by other users (Issue #2190). These functions are implicated with high confidence because:
- The attack vector explicitly targets the interface edit page's remark field
- The payloads require both storage (backend) and unsafe rendering (frontend/utility)
- The CWE-79 classification directly maps to these unsanitized input handling points.