From 8e30d0577fb8def37be62e1ef0599135e36660b9 Mon Sep 17 00:00:00 2001 From: Morgan Hill Date: Fri, 26 Sep 2025 15:18:26 +0200 Subject: [PATCH] Add basic support for Nova --- .../FuzzilliCli/Profiles/NovaProfile.swift | 63 +++++++++++++++++++ Sources/FuzzilliCli/Profiles/Profile.swift | 1 + Targets/Nova/README.md | 1 + 3 files changed, 65 insertions(+) create mode 100644 Sources/FuzzilliCli/Profiles/NovaProfile.swift create mode 100644 Targets/Nova/README.md diff --git a/Sources/FuzzilliCli/Profiles/NovaProfile.swift b/Sources/FuzzilliCli/Profiles/NovaProfile.swift new file mode 100644 index 000000000..a023214cf --- /dev/null +++ b/Sources/FuzzilliCli/Profiles/NovaProfile.swift @@ -0,0 +1,63 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Fuzzilli + +let novaProfile = Profile( + processArgs: { randomize in + var args: [String] = [] + guard randomize else { return args } + return args + }, + + processEnv: [:], + + maxExecsBeforeRespawn: 1000, + + timeout: 250, + + codePrefix: """ + """, + + codeSuffix: """ + """, + + ecmaVersion: ECMAScriptVersion.es6, + + startupTests: [ + // Check that the fuzzilli integration is available. + ("fuzzilli('FUZZILLI_PRINT', 'test')", .shouldSucceed), + + // Check that common crash types are detected. + ("fuzzilli('FUZZILLI_CRASH', 0)", .shouldCrash), + //("fuzzilli('FUZZILLI_CRASH', 1)", .shouldCrash), + //("fuzzilli('FUZZILLI_CRASH', 2)", .shouldCrash), + + // TODO we could try to check that OOM crashes are ignored here ( with.shouldNotCrash). + ], + + additionalCodeGenerators: [], + + additionalProgramTemplates: WeightedList([]), + + disabledCodeGenerators: [], + + disabledMutators: [], + + additionalBuiltins: [:], + + additionalObjectGroups: [], + + optionalPostProcessor: nil +) diff --git a/Sources/FuzzilliCli/Profiles/Profile.swift b/Sources/FuzzilliCli/Profiles/Profile.swift index d3a0038c4..b181a3902 100644 --- a/Sources/FuzzilliCli/Profiles/Profile.swift +++ b/Sources/FuzzilliCli/Profiles/Profile.swift @@ -53,4 +53,5 @@ let profiles = [ "v8holefuzzing": v8HoleFuzzingProfile, "serenity": serenityProfile, "njs": njsProfile, + "nova": novaProfile, ] diff --git a/Targets/Nova/README.md b/Targets/Nova/README.md new file mode 100644 index 000000000..e6ab8247d --- /dev/null +++ b/Targets/Nova/README.md @@ -0,0 +1 @@ +[Nova](https://github.com/trynova/nova) can be used unpatched with Fuzilli via the external [nova_fuzz](https://github.com/pcwizz/nova_fuzz) crate which implements the REPL harness.