-
Notifications
You must be signed in to change notification settings - Fork 3
Xml Fragments models #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Xml Fragments models #270
Conversation
javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/webapp/view/app.view.html
Dismissed
Show dismissed
Hide dismissed
javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/webapp/view/app.view.html
Dismissed
Show dismissed
Hide dismissed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for modeling XML fragments in SAPUI5 applications to enable XSS vulnerability detection. It introduces the ability to track data flow through programmatically instantiated fragments using both Controller.loadFragment() and Fragment.load() APIs.
Key changes:
- New
Fragment.qllmodule to model Fragment.load() API calls - Extended
UI5View.qllwith XmlFragment class to handle fragment definitions - Added two test cases demonstrating XSS detection through fragments loaded via different methods
Reviewed changes
Copilot reviewed 22 out of 24 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/Fragment.qll | New module defining FragmentLoad class to model sap.ui.core.Fragment.load() API calls and extract configuration parameters |
| javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/UI5View.qll | Extended with XmlFragment class (lines 690-777) to model XML fragments, their controllers, sources, and sinks; updated TUI5Control to include fragment.xml files |
| javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/* | Test case using Controller.loadFragment() to load a fragment with XSS source and sink |
| javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/* | Test case using Fragment.load() with explicit controller parameter to load a fragment with XSS source and sink |
Files not reviewed (2)
- javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/package-lock.json: Language not supported
- javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/webapp/controller/app.controller.js
Outdated
Show resolved
Hide resolved
javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/webapp/index.js
Show resolved
Hide resolved
javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/Fragment.qll
Show resolved
Hide resolved
javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/UI5View.qll
Outdated
Show resolved
Hide resolved
...ript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/webapp/controller/app.controller.js
Outdated
Show resolved
Hide resolved
...ript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/webapp/controller/app.controller.js
Outdated
Show resolved
Hide resolved
...frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment-load/webapp/controller/app.controller.js
Outdated
Show resolved
Hide resolved
javascript/frameworks/ui5/test/queries/UI5Xss/xss-xml-fragment/webapp/index.js
Show resolved
Hide resolved
javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/Fragment.qll
Outdated
Show resolved
Hide resolved
…d-security/codeql-sap-js into knewbury01/ui5-fragments
…ments Improve UI5Xss detection for fragments_samples 1
...eworks/ui5/test/queries/UI5Xss/xss-fragment-static-byid/webapp/controller/Main.controller.js
Dismissed
Show dismissed
Hide dismissed
...orks/ui5/test/queries/UI5Xss/xss-urlparams-jsonmodel/webapp/controller/Display.controller.js
Dismissed
Show dismissed
Hide dismissed
...eworks/ui5/test/queries/UI5Xss/xss-urlparams-jsonmodel/webapp/fragments/Content.fragment.xml
Dismissed
Show dismissed
Hide dismissed
...ript/frameworks/ui5/test/queries/UI5Xss/xss-urlparams-jsonmodel/webapp/view/Display.view.xml
Dismissed
Show dismissed
Hide dismissed
…d-security/codeql-sap-js into knewbury01/ui5-fragments
and change htmlsink def to updated one
What This PR Contributes
QL models and tests for Xml Fragments that are programatically instantiated. Covers both the use case of loading a fragment via the Fragment itself (
Fragment.load) as well as a controller'sloadFragmentFuture Works
<Fragment>tags and no programatic controller association (declarative views)