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 bug with marshling: "Failed to print unexpected end of JSON input" #5

Merged
merged 2 commits into from
Jan 2, 2022

Conversation

g3rzi
Copy link

@g3rzi g3rzi commented Jan 2, 2022

The Unmarshal function used wrong parameter sDec instead of the new one newDec.
Second issue was that some tokens are being set with bad base64.
For example:
1234 in base64 is: "MTIzNA=="
If you will remove the "==" in some places you will still get "1234" but in the Go function it remove the "4".
So using "MTIzNA" will result "123" instead of "1234".
I noticed that some service account tokens have this issue. This is why I added "}" in case it is missing.

Pull Request (PR) Checklist

  • I have read the CONTRIBUTING doc
  • PR is from a topic/feature/bugfix branch off the dev branch (right side)
  • PR is against the dev branch (left side)
  • Kubesploit compiles without errors
  • Passes linting checks and unit tests
  • Updated CHANGELOG
  • Updated README documentation (if applicable)
  • Update Kubesploit version number in pkg/merlin.go (if applicable)

Change Type

  • Addition
  • Bugfix
  • Modification
  • Removal
  • Security

Description

The `Unmarshal` function used wrong parameter `sDec` instead of the new one `newDec`.  
Second issue was that some tokens are being set with bad base64.  
For example:  
1234 in base64 is: "MTIzNA=="  
If you will remove the "==" in some places you will still get "1234" but in the Go function it remove the "4".
So using "MTIzNA" will result "123" instead of "1234".  
I noticed that some service account tokens have this issue. This is why I added "}" in case it is missing.
@g3rzi g3rzi merged commit 0de73cc into cyberark:main Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant