Skip to content

docs: fix grammar and missing articles in SECURITY.md - #17360

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
amir-rezaei:docs/fix-security-grammar-and-articles
Jul 24, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
amir-rezaei:docs/fix-security-grammar-and-articles

Conversation

@amir-rezaei

Copy link
Copy Markdown
Contributor

Description

This PR fixes grammar and missing articles in SECURITY.md.

Details

Updated sentence phrasing (numpy module has... $\to$ the numpy module has... and function directly execute $\to$ function to directly execute).

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 📖 documentation Improvements or additions to documentation labels Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

SECURITY.md clarifies that restricted_loads permits importing functions from the numpy module.

Changes

Security documentation

Layer / File(s) Summary
Clarify restricted_loads behavior
SECURITY.md
Rewords the Actual behavior description to specify that functions can be imported from the numpy module.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A bunny reads the security line,
“From numpy’s module, imports shine!”
One phrase made clear,
No policy fear,
Hop, hop—the docs now align!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: grammar and article fixes in SECURITY.md.
Description check ✅ Passed The description covers the change well, but it does not follow the template's required "Summary" section heading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@SECURITY.md`:
- Line 21: Update the security explanation around restricted_loads to state that
RestrictedUnpickler.find_class permits attributes from any module within the
numpy package, including nested submodules such as numpy.f2py.diagnose, rather
than implying access is limited to functions directly in numpy.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fd45089-115e-46e8-ba8d-69142028ba75

📥 Commits

Reviewing files that changed from the base of the PR and between 742837c and 4a10902.

📒 Files selected for processing (1)
  • SECURITY.md

Comment thread SECURITY.md

The restricted_loads function at [api/utils/__init__.py#L215](https://github.com/infiniflow/ragflow/blob/main/api/utils/__init__.py#L215) is still vulnerable leading via code execution.
The main reason is that numpy module has a numpy.f2py.diagnose.run_command function directly execute commands, but the restricted_loads function allows users import functions in module numpy.
The main reason is that the numpy module has a numpy.f2py.diagnose.run_command function to directly execute commands, but the restricted_loads function allows users to import functions in the numpy module.

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.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Describe the allowlist scope precisely.

RestrictedUnpickler.find_class allows attributes from any module whose top-level package is numpy (for example, numpy.f2py.diagnose), not only functions directly in the numpy module. Please update this security wording so it does not understate the exposure.

Suggested wording
-The main reason is that the numpy module has a numpy.f2py.diagnose.run_command function to directly execute commands, but the restricted_loads function allows users to import functions in the numpy module.
+The main reason is that the numpy package exposes `numpy.f2py.diagnose.run_command`, which can directly execute commands, while `restricted_loads` allows importing arbitrary attributes from modules whose top-level package is `numpy`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The main reason is that the numpy module has a numpy.f2py.diagnose.run_command function to directly execute commands, but the restricted_loads function allows users to import functions in the numpy module.
The main reason is that the numpy package exposes `numpy.f2py.diagnose.run_command`, which can directly execute commands, while `restricted_loads` allows importing arbitrary attributes from modules whose top-level package is `numpy`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` at line 21, Update the security explanation around
restricted_loads to state that RestrictedUnpickler.find_class permits attributes
from any module within the numpy package, including nested submodules such as
numpy.f2py.diagnose, rather than implying access is limited to functions
directly in numpy.

@JinHai-CN

Copy link
Copy Markdown
Member

@amir-rezaei Thanks for cleaning up the grammar in the RAGFlow docs! Really appreciate it. Feel free to keep the contributions coming!

@JinHai-CN
JinHai-CN merged commit 64dbc51 into infiniflow:main Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants