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

[fix] Fixed uninitialized buffer vulnerability in base64 methods. (https://hackerone.com/reports/321701) #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ronperris
Copy link

Remediation

The source code in base64.js says that both encode¹ and decode² expect a string parameter. I see two obvious solutions.

  1. Return null when base64.encode or base64.decode are given something other than a string.
  2. Convert the parameter passed into base64.encode and base64.decode into a string before encoding or decoding.

To preserve backward compatibility with existing usage that might not be expecting null as a return value from encoding or decoding values that are not strings, I think we should covert the parameter to a string then perform that encode or decode operation.

¹ https://github.com/flatiron/utile/blob/master/lib/base64.js#L12
² https://github.com/flatiron/utile/blob/master/lib/base64.js#L30

@rjd40
Copy link

rjd40 commented May 7, 2019

Any update on getting this PR merged? I'm unable to use this package because of this vulnerability.

@raphi
Copy link

raphi commented Dec 27, 2019

@indexzero could you review this PR 🙏 As @rjd40 said, we are blocked by this security issue as well

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.

3 participants