Add client steps implementation to support existing functionalities#6966
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Coverage report
Test suite run success3836 tests passing in 1483 suites. Report generated by 🧪jest coverage report action from 4feb5ae |
9c2e1fd to
7e48497
Compare
16768f3 to
59f0139
Compare
7e48497 to
159bb73
Compare
159bb73 to
e6f3577
Compare
| config.inclusions.map(async (entry) => { | ||
| if (entry.type === 'pattern') { | ||
| const sourceDir = entry.baseDir ? joinPath(extension.directory, entry.baseDir) : extension.directory | ||
| const destinationDir = entry.destination ? joinPath(outputDir, entry.destination) : outputDir |
There was a problem hiding this comment.
Path traversal: include_assets can write outside outputDir
joinPath(outputDir, entry.destination) is used directly with user-controlled config (destination). If destination is absolute (/etc) or contains ../.., it can escape outputDir and overwrite arbitrary files on the machine running the build (CI runner, developer machine). Same class of issue exists for entry.baseDir (controls sourceDir), copySourceEntry(...destination) (static destination), copyConfigKeyEntry(...destination) (configKey destination), and copyConfigKeyEntry where the config value itself can be ../../something.
Because build manifests/config are extension-provided, a malicious extension (or compromised repo) could cause the CLI to overwrite sensitive files or poison other build artifacts.
|
🤖 Code Review · #projects-dev-ai for questions ✅ Complete - 2 findings 📋 History❌ Failed → ✅ 1 findings → ❌ Failed → ❌ Failed → ✅ 1 findings → ✅ 2 findings |
bbc0817 to
7b68eb7
Compare
e6f3577 to
3f28156
Compare
3f28156 to
44034c5
Compare
f9f9e63 to
59dcaa7
Compare
44034c5 to
094a68c
Compare
59dcaa7 to
fb4c01d
Compare
0478573 to
a8b39c0
Compare
be0c2a6 to
9d3a398
Compare
903f8f5 to
e614518
Compare
9d3a398 to
2df6f2a
Compare
e614518 to
b534c43
Compare
2df6f2a to
7dc49dc
Compare
b534c43 to
ac5fd70
Compare
7dc49dc to
6ed0e29
Compare
ac5fd70 to
dcbe359
Compare
6ed0e29 to
ba771b8
Compare
dcbe359 to
e5c297b
Compare
ba771b8 to
ac63c6b
Compare
e5c297b to
63f01da
Compare
ac63c6b to
1a2349b
Compare
1a2349b to
54efb29
Compare
63f01da to
576d4ea
Compare
576d4ea to
70b51d3
Compare
54efb29 to
14298db
Compare
70b51d3 to
f140406
Compare
14298db to
ac808f8
Compare
f140406 to
6b7f418
Compare
ac808f8 to
4ac5668
Compare
4ac5668 to
eb9a421
Compare
6b7f418 to
3c9a3bb
Compare
…pattern copy - Add sanitizeDestination() that strips '..' segments from destination fields and emits a warning when any are removed - Sanitize entry.destination for all three inclusion types (pattern, static, configKey) before it reaches any path join - Add copy-time bounds check in copyByPattern: skip any file whose resolved destPath escapes outputDir and warn Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Add build step infrastructure for extension asset management
WHY are these changes introduced?
This introduces a flexible build step system to handle various asset copying and processing needs for different extension types, replacing hardcoded build logic with configurable steps.
WHAT is this pull request doing?
'admin'to theCONFIG_EXTENSION_IDSarray for admin extensionsexecuteIncludeAssetsStep- handles pattern-based, static, and config-key-driven asset copying with comprehensive test coverageexecuteCopyStaticAssetsStep- copies static assets defined in extension build manifestsexecuteCreateTaxStubStep- generates minimal JavaScript stub files for tax calculation extensionsexecuteStepByType) that dispatches to appropriate handlers based on step typeHow to test your changes?
include_assetsstep type with different inclusion strategiesinclude-assets-step.test.tsMeasuring impact
How do we know this change was effective? Please choose one:
Checklist