SkillPedia Skills Encyclopedia
中文 EN
今日更新 2026-11-18 UTC

今天还没有新提交

查看更新动态

MCP 服务 2026-10-09 13:07 UTC

azure-devops-mcp

由提交人 danhellem 提交,主要更新类型为:问题缺陷修复与稳定性提升。提交说明:fix for msrc case on attachment downloads (#1680)。解决了已知运行时异常与边界错误,提升系统稳定性。

danhellem ea8a7f6 microsoft/azure-devops-mcp

Commit提交信息原文

fix for msrc case on attachment downloads (#1680)

This pull request enhances the security and robustness of the work item
attachment download functionality by improving file name validation,
handling HTTP response codes for attachment downloads, and strengthening
related tests. The changes ensure that only valid file names are
accepted, prevent writing non-successful HTTP responses to disk, and add
comprehensive test coverage for these scenarios.

**Attachment download validation and error handling:**

* Improved file name validation in `configureWorkItemTools` to reject
empty or invalid file names, preventing path traversal and null byte
exploits.
* Added handling for HTTP response codes when downloading attachments:
now, non-successful HTTP responses (status codes outside 200–299) will
cause the download to abort, the response stream to be resumed
(drained), and an error to be thrown.
* Changed file path resolution to use `path.resolve` instead of
`path.join` to ensure the destination path is absolute and secure.

**Test improvements:**

* Enhanced the attachment download tests to cover invalid file names,
non-successful HTTP responses, and streams without HTTP metadata,
ensuring these cases are handled gracefully and securely.
* Updated the `makeReadableStream` helper in tests to support setting
HTTP status codes and messages for simulated streams.

## GitHub issue number
N/A

## **Associated Risks**

None

## ✅ **PR Checklist**

- [x] **I have read the [contribution
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CONTRIBUTING.md)**
- [x] **I have read the [code of conduct
guidelines](https://github.com/microsoft/azure-devops-mcp/blob/main/CODE_OF_CONDUCT.md)**
- [x] Title of the pull request is clear and informative.
- [x] 👌 Code hygiene
- [x] 🔭 Telemetry added, updated, or N/A
- [x] 📄 Documentation added, updated, or N/A
- [x] 🛡️ Automated tests added, or N/A

## 🧪 **How did you test it?**

Updated automated tests and ran thru several checks and manual tests