Repository navigation
🐛 fix(bash): quote Unicode source as ASCII - #3695
Merged
Merged
Conversation
gaborbernat
force-pushed
the
fix/bash-prompt-encoding
branch
from
November 20, 2026 15:16
554a97b to
8b450db
Compare
Legacy multibyte shell decoders can absorb a quote after a non-ASCII byte sequence in an activation script. Emit Unicode bytes through quoted octal substitutions and use the shell builtin in zsh, which may have no external printf.
gaborbernat
force-pushed
the
fix/bash-prompt-encoding
branch
from
November 20, 2026 15:34
8b450db to
f8e6e9a
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 17:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under GB18030, a crafted Unicode prompt could execute a shell command when a virtualenv user sourced Bash activation. Bash activation now keeps the generated source syntax ASCII and reconstructs each original value as data at runtime (draft advisory ANT-2026-UMMZJBBH).
The Bash activator keeps shell quoting for ASCII runs and emits non-ASCII bytes through quoted octal substitutions. Bash and dash use their builtins; zsh also uses its builtin even when an external
printfis absent or a shell function overrides the name. The substitutions remain quoted so customIFSvalues cannot split them.This change covers source parsing. Bash prompt redraw after a locale change is tracked separately in draft advisory ANT-2026-CR2KPIYY. Reported by oss-scanner: ANT-2026-UMMZJBBH.