Skip to content

Conversation

@Eliav2
Copy link

@Eliav2 Eliav2 commented Nov 16, 2025

Updated the data flow analysis to include document.defaultView as a source node for global variable references. Added a new test file tst4.js and updated existing tests to verify the inclusion of defaultView and its properties in the expected results.

would close this #20823

… references

Updated the data flow analysis to include `document.defaultView` as a source node for global variable references. Added a new test file `tst4.js` and updated existing tests to verify the inclusion of `defaultView` and its properties in the expected results.
@Eliav2 Eliav2 requested review from a team as code owners November 16, 2025 22:55
@github-actions github-actions bot added the JS label Nov 16, 2025
@Eliav2 Eliav2 force-pushed the 20823-globalVarRef-document-defaultView branch from 76637a9 to bd18e86 Compare November 16, 2025 23:03
…ropertyRead

Changed the method for accessing `defaultView` from `getAPropertyReference` to `getAPropertyRead` to improve accuracy in data flow analysis for global variable references.
asgerf
asgerf previously approved these changes Nov 17, 2025
Copy link
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for the PR. I've started an internal evaluation of the changes and will merge if it loosk good


### Minor Analysis Improvements

- JavaScript `DataFlow::globalVarRef` now recognizes `document.defaultView` as an alias of `window`, allowing flows such as `document.defaultView.history.pushState(...)` to be modeled and found by queries relying on `globalVarRef("history")`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I overlooked that this change note is in the wrong file. Files in the released directory are auto-generated during the release process.

Could you move this one directory up and rename it to 2025-11-19-default-view.md, and replace the headings with the preamble:

---
category: minorAnalysis
---

Copy link
Author

@Eliav2 Eliav2 Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, no problem, done, moved to lib/change-notes/2025-11-19-default-view.md ****

Introduced a new change note detailing that `DataFlow::globalVarRef` now recognizes `document.defaultView` as an alias of `window`, enhancing the modeling of data flows involving `history` in queries.
asgerf
asgerf previously approved these changes Nov 20, 2025
@asgerf
Copy link
Contributor

asgerf commented Nov 20, 2025

The globalObjectRef.expected file also needs to be updated. Could you run the test and accept the test output?

@Eliav2 Eliav2 force-pushed the 20823-globalVarRef-document-defaultView branch from c35d65f to 91451b7 Compare November 20, 2025 13:16
@Eliav2 Eliav2 requested a review from asgerf November 20, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants