Skip to content

fix(tools,gateway,agent,plugins): add usedforsecurity=False to hashlib calls - #52967

Closed
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/hashlib-usedforsecurity-v2
Closed

AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/hashlib-usedforsecurity-v2

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Problem

All hashlib.md5() and hashlib.sha1() calls in the project are used for non-security purposes (cache keys, content checksums, file hashing). On FIPS-enabled systems these calls fail with ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS without usedforsecurity=False.

Fix

Add usedforsecurity=False to all 18 hashlib calls across 9 files.

File Calls
agent/context_compressor.py md5 x1
agent/codex_responses_adapter.py sha1 x1
plugins/platforms/wecom/adapter.py md5 x1
plugins/platforms/wecom/wecom_crypto.py sha1 x1
tools/skills_sync.py md5 x1
tools/skills_hub.py md5 x5
gateway/platforms/weixin.py md5 x2
gateway/platforms/yuanbao_media.py md5 x1, sha1 x1
gateway/platforms/qqbot/chunked_upload.py md5 x3, sha1 x1

Changes

9 files, 18 lines changed (each line adds usedforsecurity=False kwarg).

…b calls

All hashlib.md5/sha1 calls in the project are used for non-security
purposes (cache keys, checksums, content hashing). On FIPS-enabled
systems these calls fail without usedforsecurity=False.

18 calls across 9 files fixed.
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery tool/skills Skills system (list, view, manage) comp/plugins Plugin system and bundled plugins platform/wecom WeCom / WeChat Work adapter duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels Jun 26, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #52783 — same author, same FIPS usedforsecurity=False fix; #52967 is a v2-branch superset of #52783 (adds one more file, plugins/platforms/wecom/wecom_crypto.py). #52783 is the earlier/canonical open PR. Maintainer can pick the broader scope, but these are the same change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/wecom WeCom / WeChat Work adapter tool/skills Skills system (list, view, manage) type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants