GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — fix(upgrade): only compile the template contents of a downgraded component by SkyZeroZx · Pull Request #71442 · angular/angular Conversation
Contributor
Previously, a downgraded component compiled whatever its element contained when the component was created. By then, AngularJS could already have linked or written content into the element, for example through The contents are now copied when the directive's controller is instantiated, before anything on the element is linked, and that copy is what gets compiled. If there is nothing to copy, whatever AngularJS put into the element is projected as it is, so content added by Fixes #71441
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
SkyZeroZx
marked this pull request as ready for review
…onent Previously, a downgraded component compiled whatever its element contained when the component was created. By then, AngularJS could already have linked or written content into the element, for example through `ng-transclude` or `ng-bind` on it, and that content was compiled again. The contents are now copied when the directive's controller is instantiated, before anything on the element is linked, and that copy is what gets compiled. If there is nothing to copy, whatever AngularJS put into the element is projected as it is, so content added by `ng-transclude` keeps the scope it was linked with. Fixes angular#71441
SkyZeroZx
force-pushed
the
fix/upgrade-projected-content-compile
branch
from
1ed0ef7 to
6e1df9b
Compare
JeanMeche
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AGENT: Using
Instead of guessing transclusion based on
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Doing some research with help of an agent (Astra) I found the following: For The The difference is an empty element filled by another directive, e.g.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsUh oh!
There was an error while loading. Please reload this page.
JeanMeche
approved these changes
|
There was an error while loading. Please reload this page.
|
TGP came back green. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think we can consider this a security issue so we can do a backporting it to LTS versions according to the issue #71441 and POC , Because it allows an attacker to compile a string as template data leading to XSS |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
downgradeComponent() compiles content that AngularJS directives wrote into its element
There was an error while loading. Please reload this page.