-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.03 KB
/
Copy pathfuzz.yml
File metadata and controls
107 lines (94 loc) · 3.03 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Fuzz Testing
on:
schedule:
- cron: '0 4 * * 1' # Weekly on Monday at 4 AM UTC
workflow_dispatch:
inputs:
duration:
description: 'Fuzz duration in seconds per target'
required: false
default: '60'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fuzz:
name: Fuzz (${{ matrix.target }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- fuzz_html_parser
- fuzz_css_parser
- fuzz_url_parser
- fuzz_xss
- fuzz_firewall
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Clang + libFuzzer
run: |
sudo apt-get update
sudo apt-get install -y clang libsdl2-dev
- name: Create include symlink
run: ln -sf ebrowser include/eBrowser
- name: Configure with fuzzing + sanitizers
run: |
CC=clang cmake -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DeBrowser_BUILD_FUZZ=ON \
-DeBrowser_BUILD_STANDALONE=OFF \
-DeBrowser_BUILD_BROWSER=OFF \
-DeBrowser_BUILD_RENDER=OFF \
-DBUILD_TESTING=OFF
- name: Build fuzz targets
run: cmake --build build --parallel $(nproc) --target ${{ matrix.target }}
- name: Determine corpus directory
id: corpus
run: |
case "${{ matrix.target }}" in
fuzz_html_parser) echo "dir=fuzz/corpus/html" >> $GITHUB_OUTPUT ;;
fuzz_css_parser) echo "dir=fuzz/corpus/css" >> $GITHUB_OUTPUT ;;
fuzz_url_parser) echo "dir=fuzz/corpus/url" >> $GITHUB_OUTPUT ;;
fuzz_xss) echo "dir=fuzz/corpus/html" >> $GITHUB_OUTPUT ;;
fuzz_firewall) echo "dir=fuzz/corpus/url" >> $GITHUB_OUTPUT ;;
esac
- name: Run fuzzer
run: |
DURATION=${{ github.event.inputs.duration || '60' }}
mkdir -p fuzz_output
echo "Running ${{ matrix.target }} for ${DURATION}s..."
timeout ${DURATION}s ./build/fuzz/${{ matrix.target }} \
fuzz_output/ ${{ steps.corpus.outputs.dir }}/ \
-max_len=65536 \
-timeout=10 \
-rss_limit_mb=2048 \
-print_final_stats=1 \
2>&1 | tail -30 || true
echo ""
echo "=== Final corpus stats ==="
ls fuzz_output/ | wc -l
echo "corpus files generated"
- name: Upload crash artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-crashes-${{ matrix.target }}
path: |
crash-*
leak-*
timeout-*
oom-*
retention-days: 30
if-no-files-found: ignore
- name: Upload corpus
if: always()
uses: actions/upload-artifact@v4
with:
name: fuzz-corpus-${{ matrix.target }}
path: fuzz_output/
retention-days: 7