Skip to content

test: Add the protocol fuzzer harness prototype#19628

Merged
rkarabut merged 1 commit intonextfrom
rk/protocol-fuzzer-prototype
Jan 21, 2026
Merged

test: Add the protocol fuzzer harness prototype#19628
rkarabut merged 1 commit intonextfrom
rk/protocol-fuzzer-prototype

Conversation

@rkarabut
Copy link
Contributor

This is a prototype fuzzing harness for Aztec contract interactions. At the moment, it utilizes aztec-up toolset present in the system to create several default token contracts with ownership randomly assigned to one of the three aztec-up test accounts, and then performs mint/burn/transfer operations over them (both private and public), keeping track of the supposed resulting balances in a state machine. The balances are also checked randomly, with the harness stopping with an assertion if they don't match the tracked values.

It is currently in a PoW state and is supposed to become a base for testing validity of side effects and the like further on, through generation of custom contract methods with fuzzed inputs. For now it's probably early to include it in CI.

@socket-security
Copy link

socket-security bot commented Jan 15, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Install-time scripts: cargo anyhow

Install script: Package overview

Source: undefined

From: noir-projects/protocol-fuzzer/Cargo.tomlcargo/anyhow@1.0.100

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/anyhow@1.0.100. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Native binaries present: cargo anyhow

Location: Package overview

From: noir-projects/protocol-fuzzer/Cargo.tomlcargo/anyhow@1.0.100

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/anyhow@1.0.100. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Native binaries present: cargo portable-atomic-util

Location: Package overview

From: ?cargo/env_logger@0.11.8cargo/portable-atomic-util@0.2.4

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/portable-atomic-util@0.2.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Install-time scripts: cargo portable-atomic-util

Install script: Package overview

Source: undefined

From: ?cargo/env_logger@0.11.8cargo/portable-atomic-util@0.2.4

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/portable-atomic-util@0.2.4. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Native binaries present: cargo portable-atomic

Location: Package overview

From: ?cargo/env_logger@0.11.8cargo/portable-atomic@1.11.1

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/portable-atomic@1.11.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Install-time scripts: cargo portable-atomic

Install script: Package overview

Source: undefined

From: ?cargo/env_logger@0.11.8cargo/portable-atomic@1.11.1

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/portable-atomic@1.11.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Install-time scripts: cargo quote

Install script: Package overview

Source: undefined

From: ?cargo/env_logger@0.11.8cargo/rsbash@2.1.0cargo/clap@4.5.53cargo/quote@1.0.42

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/quote@1.0.42. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Native binaries present: cargo quote

Location: Package overview

From: ?cargo/env_logger@0.11.8cargo/rsbash@2.1.0cargo/clap@4.5.53cargo/quote@1.0.42

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/quote@1.0.42. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Install-time scripts: cargo serde_core

Install script: Package overview

Source: undefined

From: ?cargo/env_logger@0.11.8cargo/serde_core@1.0.228

ℹ Read more on: This package | This alert | What is an install script?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/serde_core@1.0.228. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Native binaries present: cargo serde_core

Location: Package overview

From: ?cargo/env_logger@0.11.8cargo/serde_core@1.0.228

ℹ Read more on: This package | This alert | Why is native code a concern?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Verify that the inclusion of native code is expected and necessary for this package's functionality. If it is unnecessary or unexpected, consider using alternative packages without native code to mitigate potential risks.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/serde_core@1.0.228. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@rkarabut rkarabut changed the title Add the protocol fuzzer harness prototype test: Add the protocol fuzzer harness prototype Jan 15, 2026
@rkarabut rkarabut force-pushed the rk/protocol-fuzzer-prototype branch from 79cd2ad to 5bb54d4 Compare January 15, 2026 14:08
@socket-security
Copy link

socket-security bot commented Jan 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​anyhow@​1.0.1008010093100100
Addedcargo/​env_logger@​0.11.810010090100100
Addedcargo/​arbitrary@​1.4.210010093100100
Addedcargo/​arbtest@​0.2.010010093100100
Addedcargo/​rsbash@​2.1.010010093100100
Addedcargo/​clap@​4.5.539910093100100
Addedcargo/​log@​0.4.2910010093100100
Addedcargo/​regex@​1.12.210010095100100

View full report

Copy link
Contributor

@LeilaWang LeilaWang left a comment

Choose a reason for hiding this comment

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

I'm not familiar with rust so can't comment on coding style or potential problem with how the code is written. I only looked at the high level and there might be a few things we can change :)

BalanceOfPrivate { token, address, .. } => {
assert_eq!(
balance,
*pre_state.balances_public.get(&(*token, *address)).unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be balances_private?

amount,
from,
} => {
if state.owners[token] == *from
Copy link
Contributor

Choose a reason for hiding this comment

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

Anyone with enough balance can transfer, not just the owner.

}

fn check_result(&self, cmd: &Self::Command, pre_state: &Self::State, result: Self::Result) {
if let Ok(result) = result {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the result has error? Do we want to check that the failed command is expected?

}

fn gen_token_amount(u: &mut Unstructured) -> arbitrary::Result<TokenAmount> {
Ok(u32::arbitrary(u)? as TokenAmount)
Copy link
Contributor

Choose a reason for hiding this comment

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

The amount is u128 in token contract.

Self {
min_tokens: 1,
max_tokens: 4,
min_initial_public_mints: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if mins should be 0s (and no command is made), so that we can test the scenarios where activities happen with uninitialized state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mins can be zero I just felt the default scenario would be better left at 1 (or nothing would happen)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe nothing can happen (until a mint is done) is something we need to test 🤣

assert_eq!(
balance,
*pre_state.balances_public.get(&(*token, *address)).unwrap()
*pre_state.balances_private.get(&(*token, *address)).unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised this didn't cause any problem before. Maybe this doesn't get triggered at all. Is it possible the regex could be incorrect?

Copy link
Contributor

@LeilaWang LeilaWang left a comment

Choose a reason for hiding this comment

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

Thanks for creating this!

@rkarabut rkarabut force-pushed the rk/protocol-fuzzer-prototype branch from a47ef43 to 180aea9 Compare January 19, 2026 16:08
@rkarabut rkarabut force-pushed the rk/protocol-fuzzer-prototype branch from 180aea9 to e2f9056 Compare January 21, 2026 14:50
@rkarabut rkarabut added this pull request to the merge queue Jan 21, 2026
Merged via the queue into next with commit e93b631 Jan 21, 2026
16 checks passed
@rkarabut rkarabut deleted the rk/protocol-fuzzer-prototype branch January 21, 2026 20:23
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