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

Miscellaneous builder hardening #16

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

Conversation

DemiMarie
Copy link
Contributor

qubes-builder-github is exposed to untrusted input from the network, so harden it a bit more.

Not tested because I am not really sure how to test this.

rpc-services/qubesbuilder.TriggerBuild Outdated Show resolved Hide resolved
lib/functions.sh Outdated Show resolved Hide resolved
lib/functions.sh Outdated Show resolved Hide resolved
DemiMarie added 6 commits May 5, 2022 18:50
This avoids having to do so in the qrexec service.
Avoids any potential nasties.
Lots of exploits involve passing huge amounts of data, so impose an
arbitrary limit of 4096 bytes.
Makes errors more likely to be caught.
Service arguments are validated by qrexec, so they can only contain a
small subset of characters.  As it happens, the only character the shell
script winds up rejecting is '.'.  The rest would have been mangled by
qrexec already.
They make no sense here, and they can confuse shell scripts.
DemiMarie added 10 commits May 5, 2022 20:21
There is no reason for them to be longer than this.  Admittedly, this
number is arbitrary.
All qrexec-builder commands are 1 line.
Nothing more should follow this.
instead of using head(1) and a temporary file.
Bad characters in commands could potentially confuse shell scripts, so
reject them.
Should be a no-op because the grep command already only produces decent
characters.
Needed for -o pipefail
They are stripped out by the webhook now.
This allows the qrexec service to be stricter, parsing-wise.
Pointless attack surface
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.

2 participants