Objective
Implement fuzz testing for the GitHub expression parser to validate security controls against malicious expression injection attempts.
Context
This is part of the testing quality improvement initiative (discussion #3811). The expression parser validates GitHub Actions expressions in workflow files, which is security-critical for preventing injection attacks. Fuzz testing helps ensure the allowlist-based validation is robust.
Approach
- Create
pkg/workflow/expression_parser_fuzz_test.go
- Implement
func FuzzExpressionParser(f *testing.F)
- Seed the fuzzer with:
- Allowed GitHub expressions from the security allowlist
- Potentially malicious injection attempts (script tags, command injection patterns)
- Edge cases (empty expressions, very long expressions, nested delimiters)
- Verify unauthorized expressions are properly rejected
- Ensure no panic on malformed input
Files to Modify
- Create:
pkg/workflow/expression_parser_fuzz_test.go
- Reference:
pkg/workflow/expression_safety.go (validation logic)
- Reference:
pkg/workflow/expression_safety_test.go (for seed data)
Acceptance Criteria
Related
Part of testing improvement task 1 from discussion #3811
Related to #3811
AI generated by Plan Command for discussion #3811
Objective
Implement fuzz testing for the GitHub expression parser to validate security controls against malicious expression injection attempts.
Context
This is part of the testing quality improvement initiative (discussion #3811). The expression parser validates GitHub Actions expressions in workflow files, which is security-critical for preventing injection attacks. Fuzz testing helps ensure the allowlist-based validation is robust.
Approach
pkg/workflow/expression_parser_fuzz_test.gofunc FuzzExpressionParser(f *testing.F)Files to Modify
pkg/workflow/expression_parser_fuzz_test.gopkg/workflow/expression_safety.go(validation logic)pkg/workflow/expression_safety_test.go(for seed data)Acceptance Criteria
go test -fuzz=FuzzExpressionParser -fuzztime=10sRelated
Part of testing improvement task 1 from discussion #3811
Related to #3811