Repository navigation
73 lines (65 loc) · 2.36 KB
/
Copy pathfuzz.yml
File metadata and controls
73 lines (65 loc) · 2.36 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
69
70
71
72
73
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
# This workflow is managed by gh actions-lock.
# Fuzz testing for BoJ Server FFI layer
# Addresses OpenSSF Scorecard "Fuzzing" check
name: Fuzz Testing
on:
push:
branches: [main]
paths:
- 'ffi/**'
- 'mcp-bridge/**'
schedule:
- cron: '0 3 * * 3' # Weekly on Wednesday
workflow_dispatch:
permissions:
actions: read
contents: read
jobs:
fuzz-zig:
name: Zig FFI Fuzz Tests
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: read
steps:
- uses: actions/checkout@v6.0.2
- name: Install Zig
uses: mlugg/setup-zig@v2.2.1
with:
version: 0.16.0
- 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
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@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"