You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nid parameter is directly interpolated into API URL query strings in src/asset/asset-service.ts without encodeURIComponent(), allowing an attacker to inject additional query parameters or modify the request path.
On line 97, the nid is embedded directly in the URL path (${Constant.url.assetApi}${nid}/), making path traversal possible (e.g., nid="../../admin/endpoint")
Suggested Fix
Apply encodeURIComponent() to all nid values before URL interpolation:
Additionally, consider adding a basic NID format validation function (e.g., alphanumeric + limited special chars) that rejects clearly malformed values before any API call.
Summary
The
nidparameter is directly interpolated into API URL query strings insrc/asset/asset-service.tswithoutencodeURIComponent(), allowing an attacker to inject additional query parameters or modify the request path.Affected Code
File:
src/asset/asset-service.tsLine 10:
Line 76:
Line 97:
Impact
nidvalue such asfoo&admin=trueor../other-endpointcould modify the intended API requestnidoriginates from HTML attributes (<capture-eye nid="...">) which are attacker-controllable in contexts like WordPress/Elementor where user input flows into the attribute (see related issue [Security] Missing output escaping in Elementor widget render() and content_template() #73)nidis embedded directly in the URL path (${Constant.url.assetApi}${nid}/), making path traversal possible (e.g.,nid="../../admin/endpoint")Suggested Fix
Apply
encodeURIComponent()to allnidvalues before URL interpolation:Additionally, consider adding a basic NID format validation function (e.g., alphanumeric + limited special chars) that rejects clearly malformed values before any API call.