Security: Dynamic import invocation without existence check can crash route (availability risk)#1176
Conversation
A module loader function is resolved from `metaGlobComponents[componentPath]` and invoked without verifying it exists. A crafted route param that does not match a key can result in invoking `undefined`, causing runtime errors and potential repeated 500 responses (DoS-by-error for that endpoint). Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
commit: |
Summary
Security: Dynamic import invocation without existence check can crash route (availability risk)
Problem
Severity:
Low| File:apps/component-tests/src/components/showcase-test/showcase-test.tsx:L13A module loader function is resolved from
metaGlobComponents[componentPath]and invoked without verifying it exists. A crafted route param that does not match a key can result in invokingundefined, causing runtime errors and potential repeated 500 responses (DoS-by-error for that endpoint).Solution
Validate that
metaGlobComponents[componentPath]exists before invocation. Return a controlled 404/fallback component when not found, and wrap dynamic import in try/catch with graceful error handling.Changes
apps/component-tests/src/components/showcase-test/showcase-test.tsx(modified)