Skip to content

fix: use incremental hashing in CatalogDescriptor.get_hash() - #3907

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/integrations-chunked-hash
Open

fix: use incremental hashing in CatalogDescriptor.get_hash()#3907
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/integrations-chunked-hash

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

CatalogDescriptor.get_hash() called fh.read() which loads the entire file into memory before hashing. A large or maliciously sized catalog descriptor file could cause unbounded memory allocation.

Fix

Use incremental hashlib.sha256().update() with 64 KiB chunks.

Testing

  • Verified hash output matches the previous implementation for the same file

… loading entire file into memory

CatalogDescriptor.get_hash() called fh.read() which loads the entire
file into memory before hashing. Use incremental hashlib.sha256().update()
with 64 KiB chunks to prevent unbounded memory allocation on large
catalog descriptor files.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 31, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant