Skip to content

Remove EUII from x-ms-app#395

Open
yihezkel wants to merge 2 commits intomasterfrom
removeEuiiFromXMsApp
Open

Remove EUII from x-ms-app#395
yihezkel wants to merge 2 commits intomasterfrom
removeEuiiFromXMsApp

Conversation

@yihezkel
Copy link
Copy Markdown
Member

Security

Prevent leaking EUII from the file's path (e.g. "C:\Users\jdoe...\kusto-mcp-server\dist\index.js")

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 18, 2026

Unit Test Results

    1 files  ±0    18 suites  ±0   9m 51s ⏱️ -17s
281 tests ±0  273 ✔️ ±0  8 💤 ±0  0 ±0 
287 runs  ±0  279 ✔️ ±0  8 💤 ±0  0 ±0 

Results for commit b77b00c. ± Comparison against base commit d0d32ad.

♻️ This comment has been updated with latest results.

@yihezkel yihezkel requested a review from Copilot March 18, 2026 20:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a security concern by preventing potential EUII leakage in the x-ms-app header when running in Node (e.g., avoiding sending full filesystem paths that may include usernames).

Changes:

  • Update Node default application name resolution to use only the basename of process.argv[1] instead of the full path.
  • Add a path import to support basename extraction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.


import { isNodeLike } from "@azure/core-util";
import { userInfo } from "os";
import { basename } from "path";
Comment on lines +40 to +42
// Use only the base filename from argv[1] to avoid leaking the full
// filesystem path (which may contain the username).
return process?.env?.npm_package_name || (process?.argv?.[1] ? basename(process.argv[1]) : None);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants