fix(@angular/build): assert that asset input paths are within workspace root - #33223
fix(@angular/build): assert that asset input paths are within workspace root#33223alan-agius4 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces validation to ensure that asset paths are contained within the workspace root across different Angular builders. It adds a new isSubDirectory utility and implements checks in both the application and browser builders, along with corresponding unit tests. Feedback from the reviewer highlights a potential mismatch in error messages within the new test cases for string-based asset patterns. Additionally, improvements were suggested for the path validation logic to correctly handle edge cases where directory names might start with double dots and to ensure platform-specific path separators are used.
3fbfd01 to
f82ec6e
Compare
…ce root Ensure that asset patterns defined as objects with an 'input' property are validated to be within the workspace root. - In '@angular/build', introduce a shared 'isSubDirectory' utility and apply it to both 'normalizeAssetPatterns' and 'resolveAssets'. - In '@angular-devkit/build-angular', apply similar validation during 'normalizeAssetPatterns'. - Add and update integration and E2E tests to prevent regressions from absolute and relative path traversal attempts.
f82ec6e to
e2c6bfe
Compare
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Ensure that asset patterns defined as objects with an 'input' property are validated to be within the workspace root.