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

Allow PlutusMap with duplicate keys #35

Open
nielstron opened this issue Apr 3, 2024 · 0 comments
Open

Allow PlutusMap with duplicate keys #35

nielstron opened this issue Apr 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nielstron
Copy link
Contributor

The original Haskell implementation allows PlutusMap to contain duplicate keys, just as the official CBOR standard does. This is completely bogus and hence correctly ignored by cbor2, which is used by uplc to handle PlutusMap.

However this leads to the issue that it is currently not possible to correctly simulate the behaviour of contracts when passed a CBOR with duplicate keys as dictionary, leading to a potential for oversight of specific attacks.

A potential fix has been begun in https://github.com/OpShin/uplc/tree/feat/support_invalid_plutus_map, however the rigidness of the CBOR encoder/decoder implementation from cbor2 presents some significant challenges for this endeavor.

@nielstron nielstron added the enhancement New feature or request label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant