Fix variable syntax and restrict output file permissions#35
Open
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Open
Fix variable syntax and restrict output file permissions#35assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
Conversation
tb_run_function: Fix indirect variable test `[[ -v "${tb_skip_functions}" ]]`
which tested whether a variable named by the *value* of tb_skip_functions
existed, rather than testing tb_skip_functions itself. This allowed bypassing
any security function (including signature verification) by setting two
environment variables: e.g. `tb_openpgp_verify=1 tb_skip_functions=tb_openpgp_verify`.
version-parser: Tighten output file permissions from 0644 to 0600 to avoid
creating world-readable temp files before input validation completes.
https://claude.ai/code/session_01AUkdbvpoC4YFpZXtaMTypQ
ArrayBolt3
reviewed
Apr 10, 2026
Contributor
ArrayBolt3
left a comment
There was a problem hiding this comment.
Integrated the useful bit from this in ArrayBolt3@8b2832a.
|
|
||
| tb_run_function() { | ||
| [[ -v "${tb_skip_functions}" ]] || tb_skip_functions='' | ||
| [[ -v tb_skip_functions ]] || tb_skip_functions='' |
| else: | ||
| try: | ||
| output_path.touch(mode=0o644, exist_ok=True) | ||
| output_path.touch(mode=0o600, exist_ok=True) |
Contributor
There was a problem hiding this comment.
Rejected, this adds no additional security. (For one, this doesn't actually set a file mode, the output file already exists because it was created by version-validator and Path().touch() doesn't adjust file mode on files that already exist, and for two, knowing the version that the user actually downloaded is virtually useless info. The only scenario I can imagine this stifling an attacker is if they were trying to read this file to see if an MITM attack succeeded, and any attacker that can do that probably has already taken over the end-user's machine.)
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.
This PR addresses two issues in the Tor Browser update scripts:
Summary
Two bug fixes improving code correctness and security in the update utilities.
Key Changes
update-torbrowser: Changed[[ -v "${tb_skip_functions}" ]]to[[ -v tb_skip_functions ]]to properly test variable existence without quote expansionversion-parser: Changed file creation mode from0o644(world-readable) to0o600(owner-only) for improved securityImplementation Details
-vtest operator correctly evaluates whether the variable is set, rather than testing the expanded variable namehttps://claude.ai/code/session_01AUkdbvpoC4YFpZXtaMTypQ