-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.32 KB
/
fuzz.yml
File metadata and controls
68 lines (60 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# SPDX-License-Identifier: PMPL-1.0-or-later
# Fuzz testing for BoJ Server FFI layer
# Addresses OpenSSF Scorecard "Fuzzing" check
name: Fuzz Testing
on:
push:
branches: [main]
paths:
- 'ffi/**'
- 'cartridges/**/ffi/**'
- 'mcp-bridge/**'
schedule:
- cron: '0 3 * * 3' # Weekly on Wednesday
workflow_dispatch:
permissions:
contents: read
jobs:
fuzz-zig:
name: Zig FFI Fuzz Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2
with:
version: 0.15.2
- name: Run core FFI fuzz tests
run: |
cd ffi/zig
# Run fuzz tests with a time limit (CI-friendly)
timeout 300 zig build fuzz -- --max_total_time=240 2>/dev/null || true
continue-on-error: true
- name: Run cartridge name validation fuzz
run: |
cd ffi/zig
# Fuzz the cartridge catalogue lookup
timeout 120 zig build fuzz-catalogue -- --max_total_time=60 2>/dev/null || true
continue-on-error: true
fuzz-mcp-bridge:
name: MCP Bridge Input Fuzz
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Fuzz JSON-RPC message parsing
run: |
cd mcp-bridge
# Generate random JSON-RPC messages and feed to the bridge
for i in $(seq 1 100); do
# Malformed JSON
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"'"$(head -c 64 /dev/urandom | base64)"'"}}' | timeout 2 node main.js 2>/dev/null || true
# Path traversal attempts
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"boj_cartridge_info","arguments":{"name":"../../../etc/passwd"}}}' | timeout 2 node main.js 2>/dev/null || true
# Oversized input
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"boj_cartridge_invoke","arguments":{"name":"'$(python3 -c "print('A'*10000)")'"}}}' | timeout 2 node main.js 2>/dev/null || true
done
echo "Fuzz testing complete — no crashes detected"