-
Notifications
You must be signed in to change notification settings - Fork 6.8k
ci: Add tsec_test for all ng_module targets. #24066
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
Conversation
For two source files, I have to do edits of |
@devversion Please take a look. |
Instead of modifying ~250 BUILD.bazel files, instrument the ng_module macro to conveniently create tsec_test for all modules. The ts_library macro is not instrumented since most of them are about testing, schematics and examples, which are not relevant to XSS. For those that are indeed security sensitive, tsec_test is manually added into individual BUILD.bazel files.
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.
Nice, thanks for making this change. Just a couple of comments, but overall looks great!
@devversion Thanks for the review! I've resolved the comments. PTAL. |
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.
LGTM, just one minor comment. I'd like to avoid the type mixup in tsec vs. actual build
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.
lgtm
], | ||
"ban-element-setattribute": [ | ||
"../src/cdk/a11y/aria-describer/aria-reference.ts", | ||
"../src/material-experimental/mdc-checkbox/checkbox.ts", |
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.
Do you know if any of these exceptions should be eventually removed, or do they all contain valid reasons for this exception
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.
The ban-trustedtypes-createpolicy
exception is expected. We won't be able to remove it until we have better support to create trusted types for SVG.
The ban-element-innerhtml-assignments
exception is a false positive, because src/material/icon/trusted-types.ts
defines its own TrustedTypes
interface instead of pulling the type from the @types/trusted-types
package. I'm not sure why it's coded that way, but technically it can be removed.
The "ban-element-setattribute" ones are tricky. I don't see anything that raise immediate alarms, but some of those exceptions are exposing the "setAttribute" interface to users of the the custom elements, which can be abused to bypass other checks (depending on the type of the underlying elements). Those are probably hard to remove, since it will require breaking changes to the programming interface of those custom elements. That said, so far we haven't seen XSS caused by those in google3, so it might not be a big issue.
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.
LGTM for the tooling setup.
Is there anything else I need to do to get the PR merged? |
@uraj I've added the appropriate labels. It should be in the merge queue now. I assume @andrewseguin's comment is answered and we could get this in regardless for now. |
* ci: Add tsec_test for all ng_module targets. Instead of modifying ~250 BUILD.bazel files, instrument the ng_module macro to conveniently create tsec_test for all modules. The ts_library macro is not instrumented since most of them are about testing, schematics and examples, which are not relevant to XSS. For those that are indeed security sensitive, tsec_test is manually added into individual BUILD.bazel files. * fixup! ci: Add tsec_test for all ng_module targets. * fixup! ci: Add tsec_test for all ng_module targets. (cherry picked from commit d93d9a3)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Instead of updating ~250
BUILD.bazel
files, instrument theng_module
macro to conveniently createtsec_test
for all modules. Thets_library
macro is not instrumented since most of them are about testing, schematics and examples, which are not relevant to XSS. For those that are indeed security sensitive,tsec_test
is manually added into individualBUILD.bazel
files.