Handling of double quotes in command arguments
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading the sudoers manual section on command arguments and the parser or matching code that handles quoted arguments; the issue does not name specific files or tests. Reproduce the two examples from the report on a current version and trace how quoted and empty arguments are matched. Done means the allowed commands match the documented quoting rules, with regression tests covering both examples.
Written by the indexing model from the issue text.
Description
As far as I understand from the manual, double quotes can be used to escape special characters in any context and they should always be balanced (or escaped with a \). When it comes to command-line arguments though, I observe the following behaviour (on version 1.9.9 and prior; apologies I'm not able to test on the latest version):
The following entry:
test ALL = NOPASSWD: /bin/ls " foo"
results in user test being able to run these two commands:
sudo ls '" foo"'
sudo ls '"' 'foo"'
but not what is expected:
sudo ls ' foo'
and the following entry:
test ALL = NOPASSWD: /bin/ls ""
results in user test being able to run both:
sudo ls '""'
sudo ls
- Dominant language
- C
- Stars
- 1.7k
- Forks
- 306
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 22
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sudo-project/sudo
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sudo-project/sudo#583 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
sudo-project/sudo#581 · 4 comments ·
Maintainers usually reply within 1 day
-
Signal forwarded to the command is lost when it arrives between fork() and execve() of the commandOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sudo-project/sudo#566 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
sudo-project/sudo#553 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
sudo-project/sudo#552 ·
Maintainers usually reply within 1 day
All issues in sudo-project/sudo
Similar issues
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/nuttx-apps#3942 ·
Maintainers usually reply within 1 day
-
Add missing unit tests for IsAdmissionPolicyName and IsCertManagerResourceNamePossibly taken @a1h8 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kubernetes-sigs/security-profiles-operator#3644 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
ly05010419/MacNativeGames#1340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day