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

Invalid Base64 padding returned by APIs #1461

Closed
aaroncox opened this issue Jul 27, 2023 · 1 comment · Fixed by #1482 or #1893
Closed

Invalid Base64 padding returned by APIs #1461

aaroncox opened this issue Jul 27, 2023 · 1 comment · Fixed by #1482 or #1893
Assignees
Labels
bug Something isn't working 👍 lgtm OCI Work exclusive to OCI team

Comments

@aaroncox
Copy link
Contributor

Reference issue: EOSIO/eos#8161

Figured I'd bring this old issue up again because I just ran into this once more.

The padding used in the base64 implementation that nodeos uses to respond with in select API requests is invalid, which causes any library used to interpret that data to throw errors.

An example invalid response can be seen on Jungle4 when querying the eosio.token contract.

curl https://jungle4.greymass.com/v1/chain/get_raw_abi -d '{"account_name": "eosio.token"}'

Note that the end of the base64 data contained in the .abi field is ===, which itself is invalid padding for base64 data.

We have also seen responses which include = when needing ==, and vice versa. Whatever code is generating the base64 representations of this data for nodeos is doing so incorrectly on multiple fronts.

@bhazzard bhazzard added bug Something isn't working 👍 lgtm and removed triage labels Aug 3, 2023
@bhazzard bhazzard added this to the Leap v5.0.0-rc1 milestone Aug 3, 2023
@bhazzard bhazzard assigned bhazzard and heifner and unassigned bhazzard Aug 3, 2023
@bhazzard
Copy link

bhazzard commented Aug 3, 2023

There is a small chance that fixing this could "break" someone who is relying on the invalid padding. We should call this out clearly in the release notes for 5.0.

@heifner heifner added the OCI Work exclusive to OCI team label Aug 7, 2023
heifner added a commit that referenced this issue Aug 8, 2023
heifner added a commit that referenced this issue Aug 10, 2023
heifner added a commit that referenced this issue Nov 10, 2023
heifner added a commit that referenced this issue Nov 10, 2023
heifner added a commit that referenced this issue Nov 10, 2023
@heifner heifner reopened this Nov 10, 2023
heifner added a commit that referenced this issue Nov 13, 2023
- Use string_view and return vector<char> instead of string
heifner added a commit that referenced this issue Nov 13, 2023
heifner added a commit that referenced this issue Nov 13, 2023
heifner added a commit that referenced this issue Nov 13, 2023
[3.2] Do not require trailing `=` for base64 encoded strings
heifner added a commit that referenced this issue Nov 13, 2023
heifner added a commit that referenced this issue Nov 13, 2023
[3.2 -> 4.0] Do not require trailing `=` for base64 encoded strings
heifner added a commit that referenced this issue Nov 13, 2023
heifner added a commit that referenced this issue Nov 13, 2023
[5.0 -> main] Fix base64 encoding - take 2
heifner added a commit that referenced this issue Nov 14, 2023
[4.0 -> 5.0] Do not require trailing = for base64 encoded strings
heifner added a commit that referenced this issue Nov 14, 2023
[5.0 -> main] Benchmark BLS host functions, Do not require trailing = for base64 encoded strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 👍 lgtm OCI Work exclusive to OCI team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants