Skip to content

Warn against running RDoc on untrusted codebases - #1868

Merged
st0012 merged 2 commits into
masterfrom
readme-security-warning
Oct 31, 2026
Merged

st0012 merged 2 commits into
masterfrom
readme-security-warning

Conversation

@st0012

@st0012 st0012 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

RDoc is not designed to process untrusted input safely. This PR adds a Security section to the README that tells users not to run RDoc on a codebase they do not trust.

The section lists two ways that RDoc can run code. RDoc loads rdoc/discover.rb from installed gems as plugins. RDoc::Task runs the project's Rakefile. It also warns that the markup formatters pass raw HTML through, so applications that render untrusted markup must sanitize the output.

.rdoc_options is not in the list. RDoc reads it with Psych.safe_load, and Options#finish replaces any template_dir that it sets.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 00:59
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Documentation preview

View the preview

Commit: 3b4d377

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The README’s .rdoc_options example incorrectly claims that setting template_dir enables custom ERB template execution, although RDoc::Options#finish overwrites that value and the configuration documentation explicitly marks it unsupported.

1 open issue
What changed in this PR

Adds a security warning to RDoc’s README explaining why users should not generate documentation from codebases they do not trust.

Changes:

  • Documents potential Ruby code execution through templates, plugins, and Rake tasks.
  • Recommends an isolated environment without access to secrets when processing untrusted code.
File Description
README.md Adds a Security section describing execution risks and isolation guidance.

Review effort: Balanced

Comment thread README.md Resolved
Copilot AI balanced review requested due to automatic review settings October 31, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The README security guidance update has no active review issues.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 31, 2026 01:04
RDoc is not designed to process untrusted input safely. Plugins loaded
through rdoc/discover.rb and RDoc::Task Rakefiles can run Ruby code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHNhuBcKpwab7T6MS4pS8T

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the README update documenting RDoc’s trust requirements and isolation guidance.

No open issues 🎉

Review effort: Balanced

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment thread README.md Resolved
RDoc's markup formatters pass raw HTML through, so applications that
render untrusted markup must sanitize the output. Suggested by kou.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FHNhuBcKpwab7T6MS4pS8T
Copilot AI balanced review requested due to automatic review settings October 31, 2026 06:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the README security guidance update.

No open issues 🎉

Review effort: Balanced

@st0012
st0012 merged commit 0625df6 into master Oct 31, 2026
57 checks passed
@st0012
st0012 deleted the readme-security-warning branch October 31, 2026 09:09
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.

4 participants