Skip to content

fix: codeql issue for insecure temporary file#16173

Closed
qinzhouxu wants to merge 12 commits into
devfrom
qinzhouxu/codeql
Closed

fix: codeql issue for insecure temporary file#16173
qinzhouxu wants to merge 12 commits into
devfrom
qinzhouxu/codeql

Conversation

@qinzhouxu

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests unknown

Why these tests: Changed files are in packages/fx-core (core utility/security fix, not vscode-extension or templates), which is an infrastructure/non-template change, so only 2 smoke plans are selected as a basic sanity check.

Branch diff: qinzhouxu/codeqldev

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests unknown
ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

appYaml.add(projectIdField);
await fs.writeFile(projectYamlPath, appYaml.toString()); // only write yaml file once instead of write yaml file after every command
if (!this.isInTempDirectory(projectYamlPath)) {
await fs.writeFile(projectYamlPath, appYaml.toString());
appYaml.set("projectId", settings.trackingId);
await fs.writeFile(projectYamlPath, appYaml.toString());
if (!this.isInTempDirectory(projectYamlPath)) {
await fs.writeFile(projectYamlPath, appYaml.toString());
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

E2E Test Selection — AI Selected

Why these tests: Changes to ManifestUtils.ts (teamsApp driver) and settingsUtil.ts in fx-core map to teamsApp/, declarativeAgent/, and feature/multienv* per the fx-core rule; ManifestUtils is directly exercised by teamsApp and declarativeAgent scenarios, and settingsUtil affects multi-environment flows.

Cases selected (10):

  • ./teamsApp/basicBot.tests.ts
  • ./teamsApp/basicMessageExtension.tests.ts
  • ./teamsApp/basicTab.tests.ts
  • ./declarativeAgent/DeclarativeAgentBasic.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithApiKeyAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithOAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithEntra.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithNoneAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentInvalidManifestShape.tests.ts
  • ./feature/multienv.tests.ts

View pipeline run

Need to run more tests?

Comment on this PR:

  • /e2e-run ./path/to/test.tests.ts — add specific cases to AI selection
  • /e2e-run-all — run all e2e cases

Then re-run the workflow.

…ile'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests unknown

Why these tests: Changed files are in packages/fx-core (core utility/driver code, not templates or vscode-extension UI), which is a cross-cutting infrastructure fix; applying 2 smoke plans as a basic sanity check.

Branch diff: qinzhouxu/codeqldev

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests unknown
ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

…ile'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests failure

Why these tests: Changed files are in packages/fx-core (core utility/infra fixes for insecure temp file, not VS Code extension or templates), so only 2 smoke plans are selected as a basic sanity check.

Branch diff: qinzhouxu/codeqldev

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests failure

🔗 Full pipeline results

ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

@qinzhouxu

Copy link
Copy Markdown
Contributor Author

@copilot fix the code ql issue in this PR

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the code ql issue in this PR

Addressed in commit a2fa889. I updated the temp-directory guards to use case-normalized path.relative containment checks and added/updated unit tests for temp-path early-return behavior in both settings and manifest flows.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests unknown

Why these tests: Changes are in packages/fx-core (not vscode-extension or templates), fixing a CodeQL insecure temp file issue — this is a trivial/infra security fix with no template or VS Code UI impact, so only 2 smoke plans are selected as a basic sanity check.

Branch diff: qinzhouxu/codeqldev

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests unknown
ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

@qinzhouxu

Copy link
Copy Markdown
Contributor Author

@copilot there is still code ql scanning for this issue, your fix did not resolve it, fix it

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests unknown

Why these tests: Changed files are in packages/fx-core (not vscode-extension or templates), fixing a CodeQL security issue in utility files — this is an infrastructure/core fix with no direct VS Code UI feature mapping, so only 2 smoke plans are selected as a basic sanity check.

Branch diff: qinzhouxu/codeqldev

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests unknown
ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@copilot there is still code ql scanning for this issue, your fix did not resolve it, fix it

Addressed in commit 794611b. I tightened the temp-directory containment checks for both settings and manifest write guards (resolved + case-normalized path checks) and fixed the related unit tests to verify early return with no filesystem writes on temp paths.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests failure

Why these tests: Changed files are in packages/fx-core (core utilities, not vscode-extension), fixing a CodeQL security issue with no template or VS Code UI changes — treated as trivial/infra fix warranting only 2 smoke plans.

Branch diff: qinzhouxu/codeqldev

Results: ✅ 0 passed · ❌ 2 failed (of 2 plans)

Plans run:

  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • General_Teams_Agent_OpenAI_py_Remote_Debug

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests failure (0/2 passed)

🎯 Actual UI test run
🔗 Full pipeline results
📊 Detailed test report

ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qinzhouxu/codeql and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.26%. Comparing base (daa9cbf) to head (794611b).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...c/component/driver/teamsApp/utils/ManifestUtils.ts 75.00% 0 Missing and 2 partials ⚠️
...ckages/fx-core/src/component/utils/settingsUtil.ts 81.81% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev   #16173      +/-   ##
==========================================
- Coverage   87.27%   87.26%   -0.01%     
==========================================
  Files         633      633              
  Lines       33182    33198      +16     
  Branches     7756     7765       +9     
==========================================
+ Hits        28959    28971      +12     
  Misses       2402     2402              
- Partials     1821     1825       +4     
Files with missing lines Coverage Δ
...c/component/driver/teamsApp/utils/ManifestUtils.ts 75.83% <75.00%> (-0.03%) ⬇️
...ckages/fx-core/src/component/utils/settingsUtil.ts 94.44% <81.81%> (-5.56%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

4 participants