fix: pass usedforsecurity=False to md5/sha1 calls (FIPS crash) - #127211
Open
ahisblessed wants to merge 1 commit into
Open
ahisblessed wants to merge 1 commit into
ahisblessed wants to merge 1 commit into
Conversation
hashlib.md5() and hashlib.sha1() raise ValueError ("disabled for
FIPS") on FIPS-enabled platforms (RHEL 8/9 with FIPS mode) unless
usedforsecurity=False is passed. Every call site touched here is
non-security: cache-key digests and short display digests, so the
flag is safe and behavior is unchanged elsewhere.
Sites fixed (all previously without the flag):
- tools/skills_hub_clawhub.py: cache keys for ClawHub search listing/catalog
- tools/skills_hub_sources.py: well-known index memo key
- tools/skills_hub_skillssh.py: search cache key + skill detail key
- hermes_cli/web_server_profiles.py: short profile-path digest
- hermes_cli/web_routers/mcp.py: short server-name digest
- plugins/platforms/wecom/media.py: WeCom upload init payload md5
- tui_gateway/server.py: revision source digest
SHA-256 calls are FIPS-approved and intentionally untouched, as are
hmac.new(hashlib.sha1, ...) constructor references.
Verified: ast.parse on all 7 files; tests/tools/test_skills_hub*.py,
test_clawhub_*.py -> 150 passed, 1 skipped.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hashlib.md5()/hashlib.sha1()raiseValueError: [digital envelope routines] disabled for FIPSon FIPS-enabled platforms (e.g. RHEL 8/9 with FIPS mode) unlessusedforsecurity=Falseis passed. Seven call sites across the codebase call these constructors without the flag. All of them are non-security uses (cache-key digests and short display digests), so the fix is to passusedforsecurity=False— behavior is unchanged everywhere else.This continues the earlier FIPS sweeps (#56715, #56716, #56719, #62654, #64062, #64808, #66857, #73278), which left these files uncovered.
Changes
tools/skills_hub_clawhub.pyhashlib.md5tools/skills_hub_sources.pyhashlib.md5tools/skills_hub_skillssh.pyhashlib.md5hermes_cli/web_server_profiles.pyhashlib.sha1hermes_cli/web_routers/mcp.pyhashlib.sha1plugins/platforms/wecom/media.pyhashlib.md5tui_gateway/server.pyhashlib.sha1SHA-256 calls are FIPS-approved and intentionally untouched, as are
hmac.new(hashlib.sha1, ...)constructor references.Test plan
ast.parseclean on all 7 changed filespytest tests/tools/test_skills_hub_clawhub.py tests/tools/test_skills_hub_browse_sh.py tests/tools/test_clawhub_owner_http.py tests/tools/test_clawhub_zip_stream.py tests/tools/test_skills_hub.py— 150 passed, 1 skippedhashlib.md5/hashlib.sha1calls without the flag in the touched files