Skip to content

Misordered named parameters bug blog post#205

Draft
nikola-matic wants to merge 1 commit into
mainfrom
misordered-named-parameters-in-require-with-custom-errors-bug
Draft

Misordered named parameters bug blog post#205
nikola-matic wants to merge 1 commit into
mainfrom
misordered-named-parameters-in-require-with-custom-errors-bug

Conversation

@nikola-matic

Copy link
Copy Markdown
Collaborator

Date TBD

layout: post
published: true
title: 'Misordered Named Parameters in require with Custom Errors Bug'
date: '2026-05-20'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Don't forget

category: Security Alerts
---

On February 9, 2026, the Solidity team discovered a bug in the IR-based code generator that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Do we know the actual reporter (aside from the EF bug bounty), and should we use them instead of "Solidity team"?

@nikola-matic nikola-matic requested review from cameel and czepluch May 19, 2026 10:47
@nikola-matic nikola-matic self-assigned this May 19, 2026

@czepluch czepluch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good. mostly cosmetic nits from my side.


The bug was introduced in Solidity 0.8.26, which added support for passing custom errors as
the second argument to `require`.
[Solidity version 0.8.36](https://github.com/ethereum/solidity/releases/tag/v0.8.36), released on May 20, 2026, provides a fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

update date when we 0.8.36

---
layout: post
published: true
title: 'Misordered Named Parameters in require with Custom Errors Bug'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
title: 'Misordered Named Parameters in require with Custom Errors Bug'
title: 'Misordered Named Parameters in `require` with Custom Errors Bug'

category: Security Alerts
---

On February 9, 2026, the Solidity team discovered a bug in the IR-based code generator that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like a fairly long time to fix. Maybe worth mentioning in the next paragraph that due to the "very low" severity, it was not prioritized until now.


The bug was introduced in Solidity 0.8.26, which added support for passing custom errors as
the second argument to `require`.
[Solidity version 0.8.36](https://github.com/ethereum/solidity/releases/tag/v0.8.36), released on May 20, 2026, provides a fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
[Solidity version 0.8.36](https://github.com/ethereum/solidity/releases/tag/v0.8.36), released on May 20, 2026, provides a fix.
[Solidity 0.8.36](https://github.com/ethereum/solidity/releases/tag/v0.8.36), released on May 20, 2026, provides a fix.

In the same paragraph, we say "Solidity 0.8.26", so let's be consistent. Past posts also omit "version"

`require` and instantiated with named arguments in a non-declaration order - and only affects
the IR-based pipeline.

## Which Contracts are Affected?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Which Contracts are Affected?
## Which Contracts Are Affected?

previous posts use a header style with all words capitalized.

reorders arguments before encoding, and so are not affected. The bug is specific to the
`require`-with-custom-error path introduced in 0.8.26.

### Misalignment with Mixed Stack Widths

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Misalignment with Mixed Stack Widths
### Misalignment With Mixed Stack Widths

previous posts use a header style with all words capitalized.

Comment on lines +39 to +42
- `revert ErrorName({...})` statements,
- event emissions (`emit E({...})`),
- internal, external, library, and bound function calls,
- struct constructor invocations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `revert ErrorName({...})` statements,
- event emissions (`emit E({...})`),
- internal, external, library, and bound function calls,
- struct constructor invocations.
- `revert ErrorName({...})` statements
- event emissions (`emit E({...})`)
- internal, external, library, and bound function calls
- struct constructor invocations

trailing commas on a bullet list reads weird, let's just remove trailing punctuation

- event emissions (`emit E({...})`),
- internal, external, library, and bound function calls,
- struct constructor invocations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add something that explicitly states a workaround until upgrading:

Until upgrading, the bug can be avoided by writing the named arguments in declaration order, or by using positional arguments.

Comment on lines +63 to +64
any reordering - including reorderings of two arguments of the same type, where no positional
type mismatch could ever surface - which was the most surprising aspect of the bug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's a bit hard to read this sentence, since there's a comma inside the parenthetical dashes. Consider restructuring.

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