JS: Model Vue Composition API and vue-router useRoute sources via data extensions - #5
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 modeluseRoute()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, keepingVue.qllfocused on framework structure.useRoute()sources -sourceModelrows recognize the route object returned byvue-router'suseRoute()as a client-side remote flow source, coveringquery,params,path,fullPath, andhash(mapped tobrowser-url-query/browser-url-path/browser-url-fragment).summaryModelrows propagate flow throughref,shallowRef,toRef(arg to.value, value-preserving),reactive(arg to return, taint), and both overloads ofcomputed.The
computedobject 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 specificbrowser-url-*threat models (in addition toremote). This is inherent MaD framework behavior and is more precise; the library test expectations were regenerated to reflect it.Tests
library-tests/frameworks/VuecoversuseRoute().queryunderremoteFlowSource/threatModelSource, plus data-flow and taint-flow cases for all five Composition API helpers. All pass.