Skip to content

0xicarus/fuzz harness take2 - #419

Open
0xIcarus wants to merge 9 commits into
m1from
0xicarus/fuzz-harness-take2
Open

0xicarus/fuzz harness take2#419
0xIcarus wants to merge 9 commits into
m1from
0xicarus/fuzz-harness-take2

Conversation

@0xIcarus

@0xIcarus 0xIcarus commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR significantly extends the Move VM fuzzing infrastructure for the Movement security project. It introduces new fuzz harnesses, a crash replay/triage system, a semantic fuzzer with economic invariant checking, and fixes for real vulnerabilities discovered during fuzzing.

Bug fixes (discovered by fuzzer):

  • fix: global-buffer-overflow in Move value deserializer error path: removed format!("{:?}", kind) and format!("{}", layout) calls in the delayed_value deserialization error paths in values_impl.rs. These called Debug/Display on potentially corrupted data, triggering an ASAN global-buffer-overflow.
  • fix: add fixes for vulns found by fuzzer: further sanitized error messages in values_impl.rs serialization/deserialization error paths to avoid formatting untrusted layout/kind data. Also includes a PoC (testsuite/poc-constant-dos/) demonstrating bounded constant-type memory amplification (~70x at max allowed depth), with analysis confirming it is not OOM-triggerable through the real binary format path due to SIGNATURE_TOKEN_DEPTH_MAX=256.

How Has This Been Tested?

  • Fuzz harnesses were run locally against HEAD genesis; crashes were triaged with the new replay tool.
  • The global-buffer-overflow fix was confirmed by replaying the crash artifact through the fixed values_impl.rs and verifying clean ASAN output.
  • The PoC (testsuite/poc-constant-dos/) was executed in both default (depth=256) and amplification (--amplify) modes to confirm bounded behavior.
  • The semantic fuzzer was run locally and confirmed to produce valid transaction sequences with no supply-inflation panics.
  • Batch triage was run over crash directories to confirm deduplication and categorization logic.

Key Areas to Review

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify): Fuzzing infrastructure, tooling

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

0xIcarus and others added 9 commits May 17, 2026 03:59
CompiledModule { version: 1, self_module_handle_idx: ModuleHandleIndex(0), module_handles: [ModuleHandle { address: AddressIdentifierIndex(0), name: IdentifierIndex(0) }], struct_handles: [StructHandle { module: ModuleHandleIndex(0), name: IdentifierIndex(0), abilities: [], type_parameters: [StructTypeParameter { constraints: [Key, ], is_phantom: true }] }], function_handles: [], field_handles: [], friend_decls: [], struct_def_instantiations: [], function_instantiations: [], field_instantiations: [], signatures: [], identifiers: [Identifier("\0\0\0\0")], address_identifiers: [183b040060601100000030130a0a712f927171fd182b04010000000000000800], constant_pool: [], metadata: [], struct_defs: [StructDefinition { struct_handle: StructHandleIndex(0), field_information: Declared([FieldDefinition { name: IdentifierIndex(0), signature: TypeSignature(Function([Function([Function([Bool], [], )], [], ), Function([Function([Function([Function([U128, Reference(Reference(Reference(Function([Function([Bool], [], )], [], key))))], [], )], [Bool, U25l, U256, Function([Function([Function([Bool], [], )], [Function([Function([Function([Function([U128, Bool], [], )], [], )], [], )], [], )], )], [], )], )], [], )], [], )], [], )) }]) }], function_defs: [], struct_variant_handles: [], struct_variant_instantiations: [], variant_field_handles: [], variant_field_instantiations: [] }

Contains a struct with a function with an argument which is a reference to a reference. That is explicitly not allowed in add_signature_token() in struct_defs.rs
So either the test should allow this error or add_signature_token() is broken.

aptos-labs#16491 is relevant
format!("{}-{}", thread_name_clone, id)
})
.on_thread_start(on_thread_start)
.disable_lifo_slot()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change - and won't this affect lots of other things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants