Skip to content

JS: Model Vue Composition API and vue-router useRoute sources via data extensions - #5

Merged
adrienpessu merged 1 commit into
mainfrom
adrienpessu-solid-eureka
Jul 27, 2026
Merged

JS: Model Vue Composition API and vue-router useRoute sources via data extensions#5
adrienpessu merged 1 commit into
mainfrom
adrienpessu-solid-eureka

Conversation

@adrienpessu

Copy link
Copy Markdown
Owner

Why

Modern Vue apps read untrusted URL data through the Composition API (const route = useRoute(); route.query.x) and pass values through reactivity helpers (ref, shallowRef, toRef, reactive, computed). CodeQL previously did not model useRoute() as a source, and taint was lost through the reactivity wrappers, causing missed client-side taint findings (e.g. DOM-based XSS).

What

This adds support for these patterns and models the configuration as CodeQL data extensions (vue.model.yml) rather than hand-written QL, keeping Vue.qll focused on framework structure.

  • useRoute() sources - sourceModel rows recognize the route object returned by vue-router's useRoute() as a client-side remote flow source, covering query, params, path, fullPath, and hash (mapped to browser-url-query / browser-url-path / browser-url-fragment).
  • Composition API flow - summaryModel rows propagate flow through ref, shallowRef, toRef (arg to .value, value-preserving), reactive (arg to return, taint), and both overloads of computed.

The computed object overload is expressed in the extension because it relies on callback flow synthesis that data extensions support.

Notable behavior

Because these are now modeled as data-extension sources, useRoute()'s URL members are additionally reported under the specific browser-url-* threat models (in addition to remote). This is inherent MaD framework behavior and is more precise; the library test expectations were regenerated to reflect it.

Tests

library-tests/frameworks/Vue covers useRoute().query under remoteFlowSource / threatModelSource, plus data-flow and taint-flow cases for all five Composition API helpers. All pass.

…sions

Move the Vue Composition API flow summaries (ref, shallowRef, toRef,
reactive) and the vue-router useRoute() remote-source modeling out of
Vue.qll and into the vue.model.yml data extension as summaryModel and
sourceModel rows.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 928b6965-7da7-4da8-b6e6-debb96036108
@github-actions github-actions Bot added documentation Improvements or additions to documentation JS labels Jul 27, 2026
@adrienpessu
adrienpessu merged commit bd21395 into main Jul 27, 2026
8 checks passed
@adrienpessu
adrienpessu deleted the adrienpessu-solid-eureka branch July 27, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation JS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant