-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove lifetimes, better validate python/pcre lookbehinds
- Loading branch information
Showing
60 changed files
with
720 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# AFL fuzzer | ||
|
||
This fuzzer checks that the Pomsky compiler does not crash for any input, and produces valid regular expressions. | ||
|
||
The latter requirement is tested by compiling the regex with the respective regex engine. This requires the following programs to be installed: | ||
|
||
- deno (for JavaScript) | ||
- javac | ||
- python | ||
- mcs (for .NET) | ||
|
||
## Usage | ||
|
||
It is recommended to use [just](https://github.com/casey/just). When fuzzing Pomsky for the first time, run | ||
|
||
```sh | ||
just fuzz_init | ||
just fuzz in | ||
``` | ||
|
||
When you want to resume a previous fuzzing session, you can just | ||
|
||
```sh | ||
just fuzz | ||
``` | ||
|
||
## Analyze crashes | ||
|
||
When you found a crash, you might find it in `errors.txt`. If it's not in `errors.txt`, that likely means that there was an unexpected panic. To minimize it, run `just tmin <path>`, where `<path>` is the path to a file in the `out/default/crashes` folder. This command minimizes the input for the crash and creates a logfile at `log.txt` that should make it possible to identify the bug. | ||
|
||
## Report the bug | ||
|
||
Please report the bug [here](https://github.com/pomsky-lang/pomsky/issues). If you think it could be a security vulnerability, please disclose it directly per email: [email protected]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
Ruby|Oniguruma error: never ending recursion | ||
# Ruby|Oniguruma error: too big number for repeat range | ||
|
||
Rust|empty character classes are not allowed | ||
Rust|Compiled regex exceeds size limit | ||
PCRE|error compiling pattern at offset \d+: lookbehind assertion is not fixed length | ||
Py|look-behind requires fixed-width pattern | ||
|
||
PCRE|branch too long in variable-length lookbehind assertion | ||
PCRE|regular expression is too large | ||
# repetitions can be at most 65535 (2^16) | ||
PCRE|number too big in \{\} quantifier | ||
# lookbehind must not match more than 65535 (2^16) code points | ||
PCRE|lookbehind assertion is too long | ||
|
||
Java|Look-behind group does not have an obvious maximum length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
fuzz_init: | ||
cargo install cargo-afl | ||
cargo afl system-config | ||
|
||
fuzz in='-': | ||
cargo afl build | ||
cargo afl fuzz -i {{in}} -o out target/debug/afl-fuzz | ||
|
||
tmin input: | ||
rm log.txt | ||
FUZZ_LOG=1 AFL_DEBUG=1 AFL_MAP_SIZE=100000 cargo afl tmin -i {{input}} -o out.txt -- ./target/debug/afl-fuzz | ||
rm -f log.txt | ||
FUZZ_LOG=1 AFL_DEBUG=1 AFL_MAP_SIZE=100000 cargo afl tmin -i {{input}} -o out.txt -- ./target/debug/afl-fuzz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.