Skip to content

Security: Dynamic import invocation without existence check can crash route (availability risk)#1176

Open
tomaioo wants to merge 1 commit intoqwikifiers:mainfrom
tomaioo:fix/security/dynamic-import-invocation-without-existe
Open

Security: Dynamic import invocation without existence check can crash route (availability risk)#1176
tomaioo wants to merge 1 commit intoqwikifiers:mainfrom
tomaioo:fix/security/dynamic-import-invocation-without-existe

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 17, 2026

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:L13

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).

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)

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

⚠️ No Changeset found

Latest commit: 8bede63

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 17, 2026

Open in StackBlitz

npm i https://pkg.pr.new/qwik-ui@1176
npm i https://pkg.pr.new/@qwik-ui/headless@1176
npm i https://pkg.pr.new/@qwik-ui/styled@1176
npm i https://pkg.pr.new/@qwik-ui/utils@1176

commit: 8bede63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant