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

Hex Encode signer CLI outputs from StackerDB chunks #4661

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

8marz8
Copy link
Contributor

@8marz8 8marz8 commented Apr 8, 2024

Description

Hex encoding StackerDB chunks before writing to terminal to address audit security issue.

Applicable issues

@8marz8 8marz8 requested a review from jferrant April 8, 2024 23:18
@jferrant
Copy link
Collaborator

jferrant commented Apr 9, 2024

I think the standard we use when printing binary data to the terminal in the stacks core is to just convert everything to hex (though base64 also works). I think we can just do that. I would hexify it and i think we already have a to_hex function or something like that which shouldbe accessible from the signer. Maybe update the helper messages for each CLI command to indicate that it prints the chunk data in hex

@jcnelson
Copy link
Member

jcnelson commented Apr 9, 2024

Yeah, seconded -- this should be hex or base64. If the user wants to convert to binary, they can pipe it into xxd or base64

@jferrant
Copy link
Collaborator

jferrant commented Apr 9, 2024

Side note, this will have to be reopened against develop as soon as Brice finishes merging next into develop . See https://nakamotoslack.slack.com/archives/C067BHSN1SL/p1712679342282899

@8marz8
Copy link
Contributor Author

8marz8 commented Apr 9, 2024

@jferrant @jcnelson
When I remove the ANSI filtering and only encode to hex, if I pipe the output to xxd, it will still hide the sequence provided in the audit example.
Would it be the user's responsibility to safely read the output?
Just want to ensure that on our end, it's sufficient that we only encode it.

@jferrant
Copy link
Collaborator

@jferrant @jcnelson When I remove the ANSI filtering and only encode to hex, if I pipe the output to xxd, it will still hide the sequence provided in the audit example. Would it be the user's responsibility to safely read the output? Just want to ensure that on our end, it's sufficient that we only encode it.

I think it can be the user's responsibility to escape the output :)

@8marz8 8marz8 changed the title Sanitize signer CLI outputs from StackerDB chunks Hex Encode signer CLI outputs from StackerDB chunks Apr 15, 2024
@8marz8 8marz8 changed the base branch from next to develop April 15, 2024 20:04
@8marz8 8marz8 marked this pull request as ready for review April 15, 2024 20:06
@8marz8
Copy link
Contributor Author

8marz8 commented Apr 15, 2024

@jferrant Updated the base branch for the PR

@8marz8 8marz8 force-pushed the chore/sanitize-signer-cli-output branch from d813138 to fbe90ed Compare April 16, 2024 09:47
@8marz8 8marz8 merged commit 8874fd2 into develop Apr 16, 2024
1 of 2 checks passed
@8marz8 8marz8 deleted the chore/sanitize-signer-cli-output branch April 16, 2024 15:08
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants