Language: TypeScript
Label: safe
CWE: CWE-94 \u2014 Improper Control of Generation of Code ('Code Injection')
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Code:
  async setup (props, { attrs }) {
    const query = parseQuery(parseURL(url).search)
    const urlProps = query.props ? JSON.parse(query.props as string) : {}
    const path = resolve(query.path as string)
    if (!path.startsWith(devRootDir)) {
      throw new Error(`[nuxt] Cannot access path outside of project root directory: \`${path}\`.`)
    }
    const comp = await import(/* @vite-ignore */ query.path as string).then(r => r.default)
    return () => [
      h('div', 'Component Test Wrapper for ' + query.path),
      h('div', { id: 'nuxt-component-root' }, [
        h(comp, { ...attrs, ...props, ...urlProps })
      ])
    ]
  }