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

Base64 base64decode does not ignore whitespace, but should #32397

Closed
christopher-dG opened this issue Jun 23, 2019 · 14 comments
Closed

Base64 base64decode does not ignore whitespace, but should #32397

christopher-dG opened this issue Jun 23, 2019 · 14 comments
Labels
bug Indicates an unexpected problem or unintended behavior good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@christopher-dG
Copy link
Member

I'm not sure that there's actually anything in the RFC about this, but base64 strings often have newlines at regular intervals (GitHub for example sends file contents as 60-char lines).

julia> using Base64

julia> s = "bmFtZSA9ICJHZW5pZSIKdXVpZCA9ICJjNDNjNzM2ZS1hMmQxLTExZTgtMTYx\nZi1hZjk1MTE3ZmJkMWUiCmF1dGhvcnMgPSBbIkFkcmlhbiBTYWxjZWFudSA8\nZUBlc3NlbmNpYXJ5LmNvbT4iXQp2ZXJzaW9uID0gIjAuOS40IgoKW2RlcHNd\nCkFyZ1BhcnNlID0gImM3ZTQ2MGM2LTJmYjktNTNhOS04YzViLTE2ZjUzNTg1\nMWM2MyIKRGF0ZXMgPSAiYWRlMmNhNzAtMzg5MS01OTQ1LTk4ZmItZGMwOTk0\nMzJlMDZhIgpEaXN0cmlidXRlZCA9ICI4YmE4OWUyMC0yODVjLTViNmYtOTM1\nNy05NDcwMDUyMGVlMWIiCkd1bWJvID0gIjcwOGVjMzc1LWIzZDYtNWE1Ny1h\nN2NlLTgyNTdiZjk4NjU3YSIKSFRUUCA9ICJjZDNlYjAxNi0zNWZiLTUwOTQt\nOTI5Yi01NThhOTZmYWQ2ZjMiCkh0dHBDb21tb24gPSAiNzcxNzJjMWItMjAz\nZi01NGFjLWFhNTQtM2YxMTk4ZmU5ZjkwIgpKU09OID0gIjY4MmMwNmEwLWRl\nNmEtNTRhYi1hMTQyLWM4Y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WNmNWE4ZjUiCllBTUwgPSAiZGRiNmQ5MjgtMjg2OC01NzBmLWJk\nZGYtYWIzZjljZjk5ZWI2IgoKW2NvbXBhdF0KanVsaWEgPSAiMSIK"

julia> println(String(base64decode(s)))
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <e@essenciary.com>"]
version = "0.9.4"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
HttpCommon = "77172c1b-203f-54ac-aa54-3f1198fe9f90"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Millboard = "39ec1447-df44-5f4c-beaa-866f30b4d3b2"
MiniLogging = "f59402ec-0262-5707-a561-770af94bc5a6"
Nettle = "49dea1ee-f6fa-5aa6-9a11-8816cee7d4b9"
Nullables = "4d1e1d77-625e-5b40-9113-a560ec7a8ecd"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIÄÄòser = "30578b45-9adc-5946-b283-645ec420af67"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
julia = "1"

URIÄÄòser is a pretty interesting way to spell URIParser.

Plugging that same string into Python's base64.b64decode works as expected.
Applying replace(s, r"\s" => "") before decoding works, but it shouldn't be necessary and probably performs less than optimally.

Discovered through debugging this.

@Moelf
Copy link
Contributor

Moelf commented Jun 23, 2019

according to this post and the Wikipedia page it points to, \s characters in the string should be ignored when decoding, will try to make a PR

@christopher-dG
Copy link
Member Author

It's not fixed, the example above has the same issue on 1.1 and master.

@StefanKarpinski StefanKarpinski added good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request labels Jun 23, 2019
@Moelf
Copy link
Contributor

Moelf commented Jun 23, 2019

Why is that I cannot reproduce this?

julia> using Base64
julia> s = "bmFtZSA9ICJHZW5pZSIKdXVpZCA9ICJjNDNjNzM2ZS1hMmQxLTExZTgtMTYx\nZi1hZjk1MTE3ZmJkMWUiCmF1dGhvcnMgPSBbIkFkcmlhbiBTYWxjZWFudSA8\nZUBlc3NlbmNpYXJ5LmNvbT4iXQp2ZXJzaW9uID0gIjAuOS40IgoKW2RlcHNd\nCkFyZ1BhcnNlID0gImM3ZTQ2MGM2LTJmYjktNTNhOS04YzViLTE2ZjUzNTg1\nMWM2MyIKRGF0ZXMgPSAiYWRlMmNhNzAtMzg5MS01OTQ1LTk4ZmItZGMwOTk0\nMzJlMDZhIgpEaXN0cmlidXRlZCA9ICI4YmE4OWUyMC0yODVjLTViNmYtOTM1\nNy05NDcwMDUyMGVlMWIiCkd1bWJvID0gIjcwOGVjMzc1LWIzZDYtNWE1Ny1h\nN2NlLTgyNTdiZjk4NjU3YSIKSFRUUCA9ICJjZDNlYjAxNi0zNWZiLTUwOTQt\nOTI5Yi01NThhOTZmYWQ2ZjMiCkh0dHBDb21tb24gPSAiNzcxNzJjMWItMjAz\nZi01NGFjLWFhNTQtM2YxMTk4ZmU5ZjkwIgpKU09OID0gIjY4MmMwNmEwLWRl\nNmEtNTRhYi1hMTQyLWM4YjFjZjc5Y2RlNiIKTWFya2Rvd24gPSAiZDZmNDM3\nNmUtYWVmNS01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MTEtODgxNmNl\nZTdkNGI5IgpOdWxsYWJsZXMgPSAiNGQxZTFkNzctNjI1ZS01YjQwLTkxMTMt\nYTU2MGVjN2E4ZWNkIgpPcmRlcmVkQ29sbGVjdGlvbnMgPSAiYmFjNTU4ZTEt\nNWU3Mi01ZWJjLThmZWUtYWJlOGE0NjlmNTVkIgpQa2cgPSAiNDRjZmU5NWEt\nMWViMi01MmVhLWI2NzItZTJhZmRmNjliNzhmIgpSZWV4cG9ydCA9ICIxODlh\nMzg2Ny0zMDUwLTUyZGEtYTgzNi1lNjMwYmE5MGFiNjkiClJldmlzZSA9ICIy\nOTVhZjMwZi1lNGFkLTUzN2ItODk4My0wMDEyNmMyYTNhYmUiClNIQSA9ICJl\nYThlOTE5Yy0yNDNjLTUxYWYtODgyNS1hYWE2M2NkNzIxY2UiClNlcmlhbGl6\nYXRpb24gPSAiOWU4OGI0MmEtZjgyOS01YjBjLWJiZTktOWU5MjMxOTgxNjZi\nIgpTb2NrZXRzID0gIjY0NjJmZTBiLTI0ZGUtNTYzMS04Njk3LWRkOTQxZjkw\nZGVjYyIKVVJJUGFyc2VyID0gIjMwNTc4YjQ1LTlhZGMtNTk0Ni1iMjgzLTY0\nNWVjNDIwYWY2NyIKVW5pY29kZSA9ICI0ZWMwYTgzZS00OTNlLTUwZTItYjlh\nYy04ZjcyYWNmNWE4ZjUiCllBTUwgPSAiZGRiNmQ5MjgtMjg2OC01NzBmLWJk\nZGYtYWIzZjljZjk5ZWI2IgoKW2NvbXBhdF0KanVsaWEgPSAiMSIK"

julia> println(String(base64decode(s)))
name = "Genie"uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"authors = ["Adrian Salceanu <e@essenciary.com>"]version = "0.9.4"[deps]ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
HttpCommon = "77172c1b-203f-54ac-aa54-3f1198fe9f90"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Millboard = "39ec1447-df44-5f4c-beaa-866f30b4d3b2"
MiniLogging = "f59402ec-0262-5707-a561-770af94bc5a6"
Nettle = "49dea1ee-f6fa-5aa6-9a11-8816cee7d4b9"
Nullables = "4d1e1d77-625e-5b40-9113-a560ec7a8ecd"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIser = "30578b45-9adc-5946-b283-645ec420af67"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
julia = "1"

@christopher-dG
Copy link
Member Author

Well that sure is different, but it isn't correct either.

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Jun 26, 2019
@Moelf
Copy link
Contributor

Moelf commented Jun 26, 2019

Also, I find this behavior non local:

julia> s = "MWViMi01MmVhLWI2NzItZTJhZmRmNjliNzhmIgpSZWV4cG9ydCA9ICIxODlh\nMzg2Ny0zMDUwLTUyZGEtYTgzNi1lNjMwYmE5MGFiNjkiClJldmlzZSA9ICIy\nOTVhZjMwZi1lNGFkLTUzN2ItODk4My0wMDEyNmMyYTNhYmUiClNIQSA9ICJl\nYThlOTE5Yy0yNDNjLTUxYWYtODgyNS1hYWE2M2NkNzIxY2UiClNlcmlhbGl6\nYXRpb24gPSAiOWU4OGI0MmEtZjgyOS01YjBjLWJiZTktOWU5MjMxOTgxNjZi\nIgpTb2NrZXRzID0gIjY0NjJmZTBiLTI0ZGUtNTYzMS04Njk3LWRkOTQxZjkw\nZGVjYyIKVVJJUGFyc2VyID0gIjMwNTc4YjQ1LTlhZGMtNTk0Ni1iMjgzLTY0\nNWVjNDIwYWY2NyIKVW5pY29kZSA9ICI0ZWMwYTgzZS00OTNlLTUwZTItYjlh\nYy04ZjcyYWNmNWE4ZjUiCllBTUwgPSAiZGRiNmQ5MjgtMjg2OC01NzBmLWJk\nZGYtYWIzZjljZjk5ZWI2IgoKW2NvbXBhdF0KanVsaWEgPSAiMSIK";

julia> using Base64

julia> println(String(Base64.base64decode(s)))
1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
julia = "1"

@bicycle1885

@bicycle1885
Copy link
Member

bicycle1885 commented Jun 27, 2019

@Moelf Sorry, I don't understand your point. Anything wrong in your example? I think it seems to be working as I expect.

~ $ echo "
    MWViMi01MmVhLWI2NzItZTJhZmRmNjliNzhmIgpSZWV4cG9ydCA9ICIxODlh
    Mzg2Ny0zMDUwLTUyZGEtYTgzNi1lNjMwYmE5MGFiNjkiClJldmlzZSA9ICIy
    OTVhZjMwZi1lNGFkLTUzN2ItODk4My0wMDEyNmMyYTNhYmUiClNIQSA9ICJl
    YThlOTE5Yy0yNDNjLTUxYWYtODgyNS1hYWE2M2NkNzIxY2UiClNlcmlhbGl6
    YXRpb24gPSAiOWU4OGI0MmEtZjgyOS01YjBjLWJiZTktOWU5MjMxOTgxNjZi
    IgpTb2NrZXRzID0gIjY0NjJmZTBiLTI0ZGUtNTYzMS04Njk3LWRkOTQxZjkw
    ZGVjYyIKVVJJUGFyc2VyID0gIjMwNTc4YjQ1LTlhZGMtNTk0Ni1iMjgzLTY0
    NWVjNDIwYWY2NyIKVW5pY29kZSA9ICI0ZWMwYTgzZS00OTNlLTUwZTItYjlh
    Yy04ZjcyYWNmNWE4ZjUiCllBTUwgPSAiZGRiNmQ5MjgtMjg2OC01NzBmLWJk
    ZGYtYWIzZjljZjk5ZWI2IgoKW2NvbXBhdF0KanVsaWEgPSAiMSIK
    " | base64 --decode
1eb2-52ea-b672-e2afdf69b78f"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
URIParser = "30578b45-9adc-5946-b283-645ec420af67"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
julia = "1"

@Moelf
Copy link
Contributor

Moelf commented Jun 27, 2019

@bicycle1885 That's my point. The bug only appears when you have the complete s string from the beginning of the post. Even though bug happens on the line of URIParser, only use those lines from the encoded string will not reproduce the bug, thus non-local.

@bicycle1885
Copy link
Member

Ah, okay. It makes sense.

@jsulmont
Copy link
Contributor

jsulmont commented Jun 30, 2019

Hi -- I've submitted a #32457 which fixes the issue.
I have yet to come up with a test (possibly shorter than the one provided by @christopher-dG).
The title for this issue is probably misleading, as base64decode() correctly ignores whichever UInt8 input isn't in the encoding table. The bug is triggered when read_to_buffer is called with a non empty buffer (and whatever hasn't been consumed yet has to be copied at the beginning of the buffer).

jsulmont pushed a commit to jsulmont/julia that referenced this issue Jun 30, 2019
@christopher-dG
Copy link
Member Author

Thanks for tracking this down! Does this patch also work on the sample input with a newline at the end? Currently I get:

ERROR: ArgumentError: malformed base64 sequence

@jsulmont
Copy link
Contributor

jsulmont commented Jul 1, 2019

@christopher-dG yes it does. But you're right, I have added a torture test.
Should be fixed by #32457

KristofferC pushed a commit that referenced this issue Jul 3, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced
@goggle
Copy link
Contributor

goggle commented Jul 4, 2019

Can we close this issue?

@jsulmont
Copy link
Contributor

jsulmont commented Jul 4, 2019

perhaps one might want to backport #32457 to 1.2 though

@stevengj
Copy link
Member

stevengj commented Jul 5, 2019

Closed by #32457, which has been tagged to backport.

@stevengj stevengj closed this as completed Jul 5, 2019
KristofferC pushed a commit that referenced this issue Jul 8, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
KristofferC pushed a commit that referenced this issue Aug 26, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
KristofferC pushed a commit that referenced this issue Aug 26, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants