Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent candid space bombs #4014

Open
nomeata opened this issue Jun 1, 2023 · 2 comments
Open

Prevent candid space bombs #4014

nomeata opened this issue Jun 1, 2023 · 2 comments
Assignees

Comments

@nomeata
Copy link
Collaborator

nomeata commented Jun 1, 2023

The Candid spec has been updated (https://togithub.com/dfinity/candid/issues/434) and now the test suite now longer passes (#4013). Someone needs to update Motoko.

This needs a new counter during decoding. We don't actually need a predicate for “zero size type”, it should suffice (and be simpler) to notice when the buffer pointer did not get moved.

This needs to happen also in the skipping code in the rust rts, I believe. I ought to double check if the spec is clear about that and whether the test suite covers both variants (space bomb in ignored and not-ignored parts of the message.)

Candid spec compliance is presumably kinda important, if only because it looks odd if not; so maybe worth putting on the internal JIRA?

@chenyan-dfinity
Copy link
Contributor

The test suite covers both the skipped case and non-skipped case. The spec says to check the length on the wire, not on the expected type.

@crusso
Copy link
Contributor

crusso commented Jul 4, 2023

Sorry, I never noticed this issue. Will take a look soonish.

@crusso crusso self-assigned this Jul 4, 2023
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

No branches or pull requests

3 participants