fix(security): replace unregistered package names + MD5→SHA-256#351
fix(security): replace unregistered package names + MD5→SHA-256#351imran-siddique merged 16 commits intomicrosoft:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add EU AI Act, Colorado AI Act, and GPAI obligations timeline with AGT coverage mapping. Reference Microsoft Purview DSPM for AI as complementary data governance layer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Scorecard API rejects workflows with write permissions at the workflow level. id-token: write and security-events: write must be scoped to the job level only. Restores permissions: read-all at workflow level while keeping job-level write permissions intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ft#324) Add Google-style docstrings with Args, Returns, Raises, Attributes, and Example sections to MCPMessageType, MCPAdapter, and MCPServer classes. Also enhances docstrings for key methods including handle_message, _handle_tools_call, _handle_resources_read, and _map_tool_to_action. Fixes microsoft#316
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
…s (dependency confusion) (microsoft#325) - Replace !pip install agent-os with !pip install -e ../.. in all 6 notebooks; agent-os is not on PyPI and installing it from PyPI is a dependency confusion vector - Replace zendesk-sdk/freshdesk-sdk with zenpy/freshdesk (the real published SDKs) in customer-service/requirements.txt - Remove hashlib-compat from healthcare-hipaa/requirements.txt; hashlib is stdlib and hashlib-compat is not a real PyPI package
…stall agent-os with agent-os-kernel Replace all remaining instances of `pip install agent-os` (unregistered on PyPI) with `pip install agent-os-kernel` (the actual package) across docs, examples, TypeScript extensions, CLI source, tests, and SVG assets. Also fixes `pip install emk` references to point to `agent-os-kernel[full]` since emk is a submodule, not a standalone PyPI package. Completes the fix started in PR microsoft#325 which only covered notebooks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dify 65K→133K, AutoGen 42K→55K, CrewAI 28K→46K, Semantic Kernel 24K→27K, LangGraph 24K→27K, Haystack 22K→24K, Agent Framework 7.6K→8K. Added star counts for OpenAI Agents SDK (20K) and Google ADK (18K). Sorted by stars descending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…it CI - scripts/check_dependency_confusion.py: Pre-commit hook that scans for pip install commands referencing unregistered PyPI packages. Maintains an allowlist of known registered packages. - .github/workflows/weekly-security-audit.yml: Weekly CI job running dependency confusion scan, security skills scan, and weak crypto check. Uploads reports as artifacts with 90-day retention. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…icrosoft#349) * docs: add testing guide for external testers and customers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: add regulatory alignment table and Purview positioning to README Add EU AI Act, Colorado AI Act, and GPAI obligations timeline with AGT coverage mapping. Reference Microsoft Purview DSPM for AI as complementary data governance layer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(ci): restore read-all at workflow level for Scorecard verification The Scorecard API rejects workflows with write permissions at the workflow level. id-token: write and security-events: write must be scoped to the job level only. Restores permissions: read-all at workflow level while keeping job-level write permissions intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: add comprehensive docstrings to mcp_adapter.py classes (microsoft#324) Add Google-style docstrings with Args, Returns, Raises, Attributes, and Example sections to MCPMessageType, MCPAdapter, and MCPServer classes. Also enhances docstrings for key methods including handle_message, _handle_tools_call, _handle_resources_read, and _map_tool_to_action. Fixes microsoft#316 * ci: add markdown link checker workflow (microsoft#323) Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> * feat: add policy evaluation heatmap to SRE dashboard (microsoft#309) (microsoft#326) * fix: remove unregistered PyPI packages from notebooks and requirements (dependency confusion) (microsoft#325) - Replace !pip install agent-os with !pip install -e ../.. in all 6 notebooks; agent-os is not on PyPI and installing it from PyPI is a dependency confusion vector - Replace zendesk-sdk/freshdesk-sdk with zenpy/freshdesk (the real published SDKs) in customer-service/requirements.txt - Remove hashlib-compat from healthcare-hipaa/requirements.txt; hashlib is stdlib and hashlib-compat is not a real PyPI package * fix(security): complete dependency confusion fix — replace all pip install agent-os with agent-os-kernel Replace all remaining instances of `pip install agent-os` (unregistered on PyPI) with `pip install agent-os-kernel` (the actual package) across docs, examples, TypeScript extensions, CLI source, tests, and SVG assets. Also fixes `pip install emk` references to point to `agent-os-kernel[full]` since emk is a submodule, not a standalone PyPI package. Completes the fix started in PR microsoft#325 which only covered notebooks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: update framework star counts to current values Dify 65K→133K, AutoGen 42K→55K, CrewAI 28K→46K, Semantic Kernel 24K→27K, LangGraph 24K→27K, Haystack 22K→24K, Agent Framework 7.6K→8K. Added star counts for OpenAI Agents SDK (20K) and Google ADK (18K). Sorted by stars descending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Parsa Faraji Alamouti <165321600+parsa-faraji@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Zeel Desai <72783325+zeel2104@users.noreply.github.com> Co-authored-by: Xavier Garceau-Aranda <xavier.garceau-aranda@posteo.net>
- agentmesh → agentmesh-platform (5 files) - agentmesh-governance → agent-governance-toolkit - agent-os-observability → agent-os-kernel[observability] - hashlib.md5 → hashlib.sha256 (3 files) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 AI Agent: docs-sync-checker — Issues Found📝 Documentation Sync ReportIssues Found
Suggestions
Additional Notes
Action Items
Once the above issues are addressed, the documentation will be in sync. |
🤖 AI Agent: breaking-change-detector — Summary🔍 API Compatibility ReportSummaryThe changes in this pull request primarily involve replacing unregistered package names with registered ones and switching from MD5 to SHA-256 for cryptographic operations. These changes are largely non-breaking but could have downstream implications for users relying on specific package names or hash algorithms. No public API changes were detected in the diff. Findings
Migration Guide
Conclusion✅ No breaking changes were detected in the public API. However, users must update their package installation commands and ensure compatibility with SHA-256 hashes where applicable. |
🤖 AI Agent: test-generator — `packages/agent-mesh/src/agentmesh/cli/main.py`🧪 Test Coverage Analysis
|
🤖 AI Agent: security-scanner — Security Review of Pull RequestSecurity Review of Pull RequestThis PR introduces several changes, including replacing unregistered package names, switching from MD5 to SHA-256 for cryptographic operations, and adding a new script to detect dependency confusion vulnerabilities. Below is a detailed security analysis of the changes: 1. Prompt Injection Defense BypassNo direct prompt injection vulnerabilities were identified in this PR. The changes primarily focus on package renaming, cryptographic updates, and dependency confusion checks, which do not directly interact with user-provided input in a way that could lead to prompt injection. Rating: 🔵 LOW 2. Policy Engine CircumventionNo changes in this PR directly impact the policy engine or its enforcement mechanisms. The changes are primarily related to package naming and cryptographic improvements. Rating: 🔵 LOW 3. Trust Chain WeaknessesThe PR includes changes to replace MD5 hashing with SHA-256 in several locations. This is a positive change, as MD5 is considered cryptographically weak and unsuitable for security-sensitive operations. However, there are some issues: Finding 1: Use of SHA-256 for versioning
Rating: 🟡 MEDIUM 4. Credential ExposureNo credentials or sensitive information were exposed in the changes. The PR does not introduce any logging or error messages that could inadvertently leak sensitive data. Rating: 🔵 LOW 5. Sandbox EscapeNo changes in this PR affect sandboxing or process isolation mechanisms. The changes are limited to package renaming, cryptographic updates, and dependency checks. Rating: 🔵 LOW 6. Deserialization AttacksThe PR includes a check for Rating: 🔵 LOW 7. Race ConditionsNo changes in this PR introduce or modify concurrency-related code. The changes are limited to package renaming, cryptographic updates, and dependency checks. Rating: 🔵 LOW 8. Supply ChainThe PR addresses potential supply chain vulnerabilities by:
Finding 2: Dependency confusion detection limitations
Rating: 🟠 HIGH Summary of Findings
Recommendations
Let me know if you need further clarification or assistance! |
There was a problem hiding this comment.
🤖 AI Agent: code-reviewer
Review Summary
This pull request addresses two critical issues: replacing unregistered package names with registered ones to prevent dependency confusion attacks and replacing MD5 hashing with SHA-256 for improved cryptographic security. Additionally, it introduces a new GitHub Actions workflow for weekly security audits, including dependency confusion checks, weak cryptography scans, and other security-related tasks. The changes are well-documented and appear to be implemented correctly. However, there are a few areas that require attention.
🔴 CRITICAL
-
Potential False Negatives in Dependency Confusion Detection:
- The
check_dependency_confusion.pyscript uses a hardcoded list of registered packages (REGISTERED_PACKAGES). This approach is error-prone because it requires manual updates whenever new packages are added to the project. If a new package is introduced and not added to this list, it could lead to a false negative and a potential security vulnerability. - Recommendation: Instead of relying on a hardcoded list, consider querying the PyPI API to dynamically check if a package is registered. This will ensure that the check remains accurate even as new dependencies are added.
- The
-
Inadequate Handling of
pickleUsage:- The
weak-crypto-checkjob in the GitHub Actions workflow includes a check forpickle.loadusage. However, it only excludes files with certain patterns (e.g.,test_,security_skills) and does not provide a mechanism to validate whether the usage ofpickleis safe. - Recommendation: Implement a more robust mechanism to validate
pickleusage. For example, enforce the use ofpickleonly in trusted contexts or replace it with safer serialization libraries likejsonorMessagePack.
- The
🟡 WARNING
-
Breaking Changes in Package Names:
- The renaming of packages (e.g.,
agentmesh→agentmesh-platform,agentmesh-governance→agent-governance-toolkit) is a breaking change for users who rely on the old package names in their dependencies. - Recommendation: Clearly document these changes in the release notes and provide a migration guide for users. Consider publishing a deprecation notice for the old package names on PyPI, if applicable.
- The renaming of packages (e.g.,
-
Backward Compatibility for MD5 Replacement:
- Replacing
hashlib.md5withhashlib.sha256may cause issues if the MD5 hashes were being used for compatibility with other systems or as part of a protocol. - Recommendation: Verify that the change to SHA-256 does not break compatibility with any external systems or protocols. If compatibility is a concern, consider making the hash algorithm configurable.
- Replacing
💡 SUGGESTIONS
-
Enhance Dependency Confusion Detection:
- The
check_dependency_confusion.pyscript currently scans forpip installcommands in various file types. However, it does not account for dynamically constructed package names or indirect dependencies. - Recommendation: Consider integrating a tool like PyUp Safety or pip-audit into the CI pipeline for a more comprehensive dependency security check.
- The
-
Improve Logging for Security Scans:
- The
security-skills-scanjob in the GitHub Actions workflow usesteeto write the output to a file and the console. However, the output format is not standardized, which could make it harder to parse and analyze. - Recommendation: Use a structured logging format (e.g., JSON or YAML) for the scan output to facilitate automated analysis and integration with other tools.
- The
-
Add Tests for Dependency Confusion Script:
- The
check_dependency_confusion.pyscript does not appear to have any associated tests. - Recommendation: Add unit tests for this script to ensure its correctness and to prevent regressions. For example, test cases could include valid and invalid
pip installcommands, as well as edge cases like multiline commands.
- The
-
Document Security Audit Workflow:
- The new
weekly-security-audit.ymlworkflow is a valuable addition, but it is not mentioned in the documentation. - Recommendation: Update the repository's documentation to explain the purpose and usage of the new workflow. Include instructions for interpreting the reports and addressing any findings.
- The new
-
Optimize Regular Expressions:
- The
PIP_INSTALL_REregex incheck_dependency_confusion.pycould be simplified and made more robust. For example, it currently does not handle cases wherepip installcommands are split across multiple lines using\. - Recommendation: Refactor the regex to handle multiline
pip installcommands and edge cases. Consider using a library likeshlexto parse shell commands more reliably.
- The
-
Thread Safety of Cryptographic Changes:
- The replacement of
hashlib.md5withhashlib.sha256appears to be thread-safe, as thehashlibmodule is designed to be thread-safe. However, it would be prudent to confirm that no shared state is being modified in multithreaded contexts. - Recommendation: Review the usage of
hashlibin the context of multithreaded execution to ensure there are no race conditions or shared state issues.
- The replacement of
Summary of Changes
- 🔴 CRITICAL: Address potential false negatives in dependency confusion detection and improve
pickleusage validation. - 🟡 WARNING: Document breaking changes in package names and verify compatibility of MD5-to-SHA-256 changes.
- 💡 SUGGESTION: Enhance dependency confusion detection, improve logging, add tests for the new script, and document the security audit workflow.
Please address the critical issues and consider the warnings and suggestions before merging this pull request. Let me know if you need further clarification or assistance!
Fixes that didn't land in empty PR #349:
9 files, 11 replacements. Verified zero remaining instances.