Use system2 to avoid shell injection

Open
#460 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
r
Domain
security

Research direction

Start at R/scaffold.R line 121, following the linked revision, and inspect how the pkg value reaches the shell command. Compare the existing call with R's system2() documentation. Done means the scaffold command no longer allows pkg to be interpreted as shell syntax while preserving its intended behavior; check any relevant scaffold workflow afterward.

Written by the indexing model from the issue text.

Description

https://github.com/ramnathv/htmlwidgets/blob/7b9c1ea3d9fbf4736d84f1fd1178fce0af29f8e3/R/scaffold.R#L121

IINM this could be subject to shell injection if pkg can be passed as an arbitrary input.

system2() should have roughly the same level of code complexity & avoids this issue

Dominant language
R
Stars
801
Forks
202
PR merge metrics
No merged PRs in 30d

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ramnathv/htmlwidgets

All issues in ramnathv/htmlwidgets

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.