Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaDarochek committed Nov 28, 2023
1 parent 7b4acc3 commit 8fa5993
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,11 @@ Triage libFuzzer crashes with casr-libfuzzer:
Triage Atheris crashes with casr-libfuzzer:

$ unzip casr/tests/casr_tests/python/ruamel.zip
$ cp casr/tests/casr_tests/python/yaml_fuzzer.py .
$ casr-libfuzzer -i casr/tests/casr_tests/casrep/atheris_crashes_ruamel_yaml -o casr/tests/tmp_tests_casr/casr_libfuzzer_atheris_out -- ./yaml_fuzzer.py
$ casr-libfuzzer -i casr/tests/casr_tests/casrep/atheris_crashes_ruamel_yaml -o casr/tests/tmp_tests_casr/casr_libfuzzer_atheris_out -- casr/tests/casr_tests/python/yaml_fuzzer.py

Triage Jazzer.js crashes with casr-libfuzzer:
$ unzip casr/tests/casr_tests/js/crashes.zip -d crashes
$ cp casr/tests/casr_tests/js/test_casr_libfuzzer_jazzer_js.js .
$ casr-libfuzzer -i ./crashes -o casr/tests/tmp_tests_casr/casr_libfuzzer_jazzer_js_out -- npx jazzer ./test_casr_libfuzzer_jazzer_js.js
$ casr-libfuzzer -i ./crashes -o casr/tests/tmp_tests_casr/casr_libfuzzer_jazzer_js_out -- npx jazzer casr/tests/casr_tests/js/test_casr_libfuzzer_jazzer_js.js

Upload new and unique CASR reports to
[DefectDojo](https://github.com/DefectDojo/django-DefectDojo):
Expand Down
6 changes: 3 additions & 3 deletions casr/src/bin/casr-js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::process::Command;
fn main() -> Result<()> {
let matches = clap::Command::new("casr-js")
.version(clap::crate_version!())
.about("Create CASR reports (.casrep) from JS reports")
.about("Create CASR reports (.casrep) from JavaScript crash reports")
.term_width(90)
.arg(
Arg::new("output")
Expand Down Expand Up @@ -71,7 +71,7 @@ fn main() -> Result<()> {
)
.get_matches();

init_ignored_frames!("js"); //TODO
init_ignored_frames!("js");
if let Some(path) = matches.get_one::<PathBuf>("ignore") {
util::add_custom_ignored_frames(path)?;

Check warning on line 76 in casr/src/bin/casr-js.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-js.rs#L76

Added line #L76 was not covered by tests
}
Expand Down Expand Up @@ -135,7 +135,7 @@ fn main() -> Result<()> {
report.js_report = js_stderr_list[start..].to_vec();
report
.js_report
.retain(|x| !x.is_empty() && (x.trim().starts_with("at") || x.contains("Error")));
.retain(|x| !x.is_empty() && (x.trim().starts_with("at") || x.contains("Error:")));
let report_str = report.js_report.join("\n");
report.stacktrace = JsStacktrace::extract_stacktrace(&report_str)?;
if let Some(exception) = JsException::parse_exception(&report.js_report[0]) {
Expand Down
2 changes: 1 addition & 1 deletion casr/tests/casr_tests/js/test_casr_js_jazzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ function fuzz(data) {
module.exports.fuzz = function (data /*: Buffer */) {
const fuzzerData = data.toString();
fuzz(fuzzerData);
};
};
2 changes: 1 addition & 1 deletion casr/tests/casr_tests/js/test_casr_libfuzzer_jazzer_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ function fuzz(data) {
module.exports.fuzz = function (data /*: Buffer */) {
const fuzzerData = data.toString();
fuzz(fuzzerData);
};
};
6 changes: 2 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,11 @@ binary with `casr-gdb`:
Atheris example:

$ unzip casr/tests/casr_tests/python/ruamel.zip
$ cp casr/tests/casr_tests/python/yaml_fuzzer.py .
$ casr-libfuzzer -i casr/tests/casr_tests/casrep/atheris_crashes_ruamel_yaml -o casr/tests/tmp_tests_casr/casr_libfuzzer_atheris_out -- ./yaml_fuzzer.py
$ casr-libfuzzer -i casr/tests/casr_tests/casrep/atheris_crashes_ruamel_yaml -o casr/tests/tmp_tests_casr/casr_libfuzzer_atheris_out -- casr/tests/casr_tests/python/yaml_fuzzer.py

Jazzer.js example:
$ unzip casr/tests/casr_tests/js/crashes.zip -d crashes
$ cp casr/tests/casr_tests/js/test_casr_libfuzzer_jazzer_js.js .
$ casr-libfuzzer -i ./crashes -o casr/tests/tmp_tests_casr/casr_libfuzzer_jazzer_js_out -- npx jazzer ./test_casr_libfuzzer_jazzer_js.js
$ casr-libfuzzer -i ./crashes -o casr/tests/tmp_tests_casr/casr_libfuzzer_jazzer_js_out -- npx jazzer casr/tests/casr_tests/js/test_casr_libfuzzer_jazzer_js.js

You can set environment variable `RUST_BACKTRACE=(1|full)` for `casr-libfuzzer`. This
variable may be used by [casr-san](#casr-san).
Expand Down

0 comments on commit 8fa5993

Please sign in to comment.