René's URL Explorer Experiment


Title: fix(@angular/cli): validate path options against MCP roots in host execution by JeanMeche · Pull Request #34773 · angular/angular-cli · GitHub

Open Graph Title: fix(@angular/cli): validate path options against MCP roots in host execution by JeanMeche · Pull Request #34773 · angular/angular-cli

X Title: fix(@angular/cli): validate path options against MCP roots in host execution by JeanMeche · Pull Request #34773 · angular/angular-cli

Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes Other... Please describe: What is the current behavior? In the MCP server (ng mcp), createRootRestrictedHost only checked effectiveCwd before calling executeNgCommand / startNgProcess. Option flags forwarded from run_target via serializeOptions (such as --output-path, --out-file, --output-file, --ts-config, --runner-config, --karma-config, etc.) were passed directly to the spawned ng command without verifying that their paths remained within the allowed MCP roots. For example, invoking run_target with {"target": "build", "options": {"output-path": "/path/outside/root"}} allowed the spawned builder to escape the root-restricted boundary, recursively clean the target directory via deleteOutputDir (since deleteOutputDir only rejects exact equality with the workspace root), and write build outputs outside allowed MCP roots. Issue Number: b/587904432 What is the new behavior? createRootRestrictedHost (packages/angular/cli/src/commands/mcp/host.ts): Validates path-bearing, glob-based, and output-directory CLI flags passed to executeNgCommand and startNgProcess against the active allowed MCP roots (supporting both --flag=value and separate --flag value forms, camelCase/kebab-case/snake_case keys, dot-notation, negation forms with =, --runner-args, and passthrough args after --). Rejects output directory flags (--output-path, --output-dir, etc.) when the resolved target is outside allowed roots or is equal to / an ancestor of the effective workspace directory or any allowed root. Validates compound relative output flags (--out-file, --resources-output-path) against both cwd and any supplied output directory, regardless of argument order. Leaves non-filesystem flags intact (e.g., --base-href, --deploy-url, --serve-path, --route, --routes, --filter, --delete-output-path, --output-hashing, --output-mode, and boolean values for union options such as index, server, serviceWorker, and runnerConfig). Hardens real-path resolution in createRootRestrictedHost to follow dangling symlinks, handle intermediate symlinks before .. segments, and check exact path separator boundaries (.. directory prefixes such as ..hidden.txt inside a root are allowed). serializeOptions (packages/angular/cli/src/commands/mcp/tools/run-target/options-serializer.ts): Tightens option key validation to require a leading alphanumeric character (^[a-zA-Z0-9][a-zA-Z0-9-_]*$). Rejects null bytes (\0) in string option values. Normalizes excludeKeys comparison so case/separator variants cannot bypass excluded keys (e.g., watch). run_target strategies (build-target-strategy.ts, generic-target-strategy.ts, unit-test-strategy.ts): Re-throws non-CommandError exceptions (such as root access-denied errors from createRootRestrictedHost) instead of catching them as failed command execution logs. Does this PR introduce a breaking change? Yes No Other information deleteOutputDir in @angular/build was intentionally left unchanged so direct ng build CLI invocations with explicit external absolute output paths (e.g. /tmp/...) continue to work as expected; confinement is enforced at the MCP host boundary.

Open Graph Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

X Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

Opengraph URL: https://github.com/angular/angular-cli/pull/34773

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:73dc7ee5-7c77-6db9-b87d-14d261a1b4ec
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA8C0:3136D1:38B90A:4CD38F:6B061BF5
html-safe-nonce1e9d7f5737432dc4c189776492958f3df06cdb4db2906188b6ab67b6867ec632
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEMwOjMxMzZEMTozOEI5MEE6NENEMzhGOjZCMDYxQkY1IiwidmlzaXRvcl9pZCI6IjQxMTkxMzA2NTgwOTI0ODk3MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacff9c9b7c59e2e8020718932c825405dd56e02f5edb67b4ef4796df319e516220
hovercard-subject-tagpull_request:5439727257
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/34773/files
twitter:imagehttps://avatars.githubusercontent.com/u/1300985?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1300985?s=400&v=4
og:image:altPR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9a7c5824b75ea2ec5e3de73a483229c7bb9f32a774ffd401f010dd9bacf1483d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb25c3080e84402f75431d8dc7a96b2635219cec7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/34773/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34773%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34773%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/pull/34773/files
Reloadhttps://github.com/angular/angular-cli/pull/34773/files
Reloadhttps://github.com/angular/angular-cli/pull/34773/files
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
JeanMechehttps://github.com/JeanMeche
angular:mainhttps://github.com/angular/angular-cli/tree/main
JeanMeche:fix/mcp-run-target-path-validationhttps://github.com/JeanMeche/angular-cli/tree/fix/mcp-run-target-path-validation
Conversation 11 https://github.com/angular/angular-cli/pull/34773
Commits 2 https://github.com/angular/angular-cli/pull/34773/commits
Checks 38 https://github.com/angular/angular-cli/pull/34773/checks
Files changed 8 https://github.com/angular/angular-cli/pull/34773/files
fix(@angular/cli): validate path options against MCP roots in host execution https://github.com/angular/angular-cli/pull/34773/files#top
Show all changes 2 commits https://github.com/angular/angular-cli/pull/34773/files
196b357 fix(@angular/cli): validate path options against MCP roots in host ex… JeanMeche Nov 22, 2026 https://github.com/angular/angular-cli/pull/34773/commits/196b357057b867013088f700badad38cfbe07668
c492a9d fixup! fix(@angular/cli): validate path options against MCP roots in … JeanMeche Nov 24, 2026 https://github.com/angular/angular-cli/pull/34773/commits/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1
Clear filters https://github.com/angular/angular-cli/pull/34773/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
host.ts https://github.com/angular/angular-cli/pull/34773/files#diff-23d30b867a3d3fb5f0de1b0b18f070515d2eaaa33db4935d4851628771e68cb1
host_spec.ts https://github.com/angular/angular-cli/pull/34773/files#diff-6874902a2e5030fe1557e4178cc44b1d5a25133d2fee6eaa9c68c919f70d48af
build-target-strategy.ts https://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
generic-target-strategy.ts https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
options-serializer.ts https://github.com/angular/angular-cli/pull/34773/files#diff-3bf16b4a5111382606310d560c947bf97d88a6fb36e27ec2f4f78869bd45e627
options-serializer_spec.ts https://github.com/angular/angular-cli/pull/34773/files#diff-f2162c3cb444b001494ab4e590dbd91077969af5d52a6cdcfa205def45a41f3f
run-target_spec.ts https://github.com/angular/angular-cli/pull/34773/files#diff-3b91bbb6371bd6ac2de5113887fb2be8f7f8677fdcbe6fb2a1cf0b47ce865b46
unit-test-strategy.ts https://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
packages/angular/cli/src/commands/mcp/host.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-23d30b867a3d3fb5f0de1b0b18f070515d2eaaa33db4935d4851628771e68cb1
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/host.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
packages/angular/cli/src/commands/mcp/host_spec.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-6874902a2e5030fe1557e4178cc44b1d5a25133d2fee6eaa9c68c919f70d48af
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/host_spec.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
packages/angular/cli/src/commands/mcp/tools/run-target/build-target-strategy.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/build-target-strategy.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
https://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
https://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
https://github.com/angular/angular-cli/pull/34773/files#diff-508e13db7eb9fd0ffc626c2e59b35ea593b4e656950fb1fb7737a7b51303c548
packages/angular/cli/src/commands/mcp/tools/run-target/generic-target-strategy.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/generic-target-strategy.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
https://github.com/angular/angular-cli/pull/34773/files#diff-8e3a3240eea91f098c308eb085a769b8f6821228c97467ef15102b7b3494bd79
packages/angular/cli/src/commands/mcp/tools/run-target/options-serializer.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-3bf16b4a5111382606310d560c947bf97d88a6fb36e27ec2f4f78869bd45e627
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/options-serializer.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-3bf16b4a5111382606310d560c947bf97d88a6fb36e27ec2f4f78869bd45e627
alan-agius4https://github.com/alan-agius4
Nov 24, 2026https://github.com/angular/angular-cli/pull/34773/files#r4677447960
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
https://github.com/angular/angular-cli/pull/34773/files#diff-3bf16b4a5111382606310d560c947bf97d88a6fb36e27ec2f4f78869bd45e627
packages/angular/cli/src/commands/mcp/tools/run-target/options-serializer_spec.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-f2162c3cb444b001494ab4e590dbd91077969af5d52a6cdcfa205def45a41f3f
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/options-serializer_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-f2162c3cb444b001494ab4e590dbd91077969af5d52a6cdcfa205def45a41f3f
packages/angular/cli/src/commands/mcp/tools/run-target/run-target_spec.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-3b91bbb6371bd6ac2de5113887fb2be8f7f8677fdcbe6fb2a1cf0b47ce865b46
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/run-target_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-3b91bbb6371bd6ac2de5113887fb2be8f7f8677fdcbe6fb2a1cf0b47ce865b46
https://github.com/angular/angular-cli/pull/34773/files#diff-3b91bbb6371bd6ac2de5113887fb2be8f7f8677fdcbe6fb2a1cf0b47ce865b46
https://github.com/angular/angular-cli/pull/34773/files#diff-3b91bbb6371bd6ac2de5113887fb2be8f7f8677fdcbe6fb2a1cf0b47ce865b46
packages/angular/cli/src/commands/mcp/tools/run-target/unit-test-strategy.tshttps://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
View file https://github.com/angular/angular-cli/blob/c492a9d17bc3e1cd14ab949df65ae55d0eaaf0a1/packages/angular/cli/src/commands/mcp/tools/run-target/unit-test-strategy.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34773/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
https://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
https://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
https://github.com/angular/angular-cli/pull/34773/files#diff-1e6aafb00fa109c31b07bcf14445fecf49f21ee22a905a6960cde97aa5af60b7
Please reload this pagehttps://github.com/angular/angular-cli/pull/34773/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.