Skip to content

test : added vitest unit tests for safeExecML script execution guard#1960

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

test : added vitest unit tests for safeExecML script execution guard#1960
tmdeveloper007 wants to merge 1 commit into
gopaljilab:mainfrom
tmdeveloper007:#1955

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #1955.

Summary of What Has Been Done:
Added 18 vitest unit tests for the security validation paths in server/utils/exec.ts. The tests cover all security checks: executable type whitelisting (python3/python allowed, others rejected), argument count requirements, script name whitelisting (analyze.py only), command whitelisting (predict_file/train only), and flag injection detection.

Changes Made:

  • server/utils/exec.test.ts (new file, 128 lines)

Impact it Made:
All 18 tests pass. Lint and typecheck clean. Improves test coverage for server/utils/.

Note: Please assign this PR to the tmdeveloper007 account.

- Tests executable validation (python3/python allowed, bash/node rejected)
- Tests argument count validation (requires at least 2 args)
- Tests script name whitelisting (analyze.py allowed, others rejected)
- Tests command whitelisting (predict_file/train allowed, others rejected)
- Tests flag injection detection (hyphen-prefixed args rejected)
@vercel

vercel Bot commented Jun 26, 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:testing Adding, updating, or fixing unit/integration tests. label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:testing Adding, updating, or fixing unit/integration tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add vitest unit tests for safeExecML script execution guard

1 participant