Skip to content

fix: add usedforsecurity=False to hashlib.sha256/sha1 calls for FIPS - #51973

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

fix: add usedforsecurity=False to hashlib.sha256/sha1 calls for FIPS#51973
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/sha-usedforsecurity

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Summary

Follow-up to PR #51962 (md5 fix). hashlib.sha256() and hashlib.sha1() without usedforsecurity=False also fail on FIPS-enabled systems (RHEL 8/9 FIPS mode, government/enterprise Linux, hardened Docker images).

All 48 call-sites across 39 files use SHA for non-security purposes (cache keys, content hashing, deduplication, checksums).

Error on FIPS systems

ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS

Changes (39 files, 48 replacements)

Module Files Usage
agent/ 6 session hashing, tool guardrails, credential digests
gateway/ 7 session keys, status checks, pairing, auth
hermes_cli/ 6 auth tokens, kanban DB, copilot auth
plugins/ 12 dashboard auth, memory providers, platform adapters
tools/ 5 checkpoint, file sync, skills guard/hub, security
other 3 run_agent, weixin, wecom

Testing

  • All 39 modified files parse cleanly with ast.parse()
  • Mechanical one-line-per-site change, no logic changes
  • usedforsecurity parameter available since Python 3.9 (project requires >=3.11)

Follow-up to the md5 fix (NousResearch#51962). hashlib.sha256() and hashlib.sha1()
without usedforsecurity=False also fail on FIPS-enabled systems.

All 48 call-sites across 39 files use SHA for non-security purposes
(cache keys, content hashing, deduplication, checksums).

Files: agent/ (6), gateway/ (7), hermes_cli/ (6), plugins/ (12),
tools/ (5), run_agent.py, and other modules.
@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 comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins tool/file File tools (read, write, patch, search) P3 Low — cosmetic, nice to have labels Jun 24, 2026
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/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/file File tools (read, write, patch, search) type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants