Skip to content

test : added pytest unit tests for app/ml/security.py#1868

Open
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1863
Open

test : added pytest unit tests for app/ml/security.py#1868
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1863

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1863.

Summary of What Has Been Done:
Added pytest tests for app/ml/security.py covering SafeUnpickler class restrictions (allowed/forbidden modules), HMAC signature computation and verification functions, and the safe_pickle_load wrapper. All 13 tests pass.

Changes Made:

  • tests/test_ml_security.py (new file): 152 lines covering SafeUnpickler, compute_signature, verify_signature, write_signature, safe_pickle_load

Impact it Made:

  • Guards ML model loading against pickle RCE (CWE-502)
  • Increases Python test coverage for security-critical module
  • Verified: python3 -m pytest tests/test_ml_security.py -v --noconftest (13 passed)

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the gopaljilab's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the type:security Vulnerability fixes or security-related enhancements. label Jun 24, 2026
Cover SafeUnpickler module restrictions, HMAC signature operations,
and safe_pickle_load. All 13 tests pass.
@github-actions github-actions Bot added the type:testing Adding, updating, or fixing unit/integration tests. label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:security Vulnerability fixes or security-related enhancements. type:testing Adding, updating, or fixing unit/integration tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add pytest unit tests for app/ml/security.py

1 participant