Security discussion: Unauthenticated /v1/* endpoints + proposed non-invasive mitigation #13015
Replies: 8 comments 2 replies
-
|
support |
Beta Was this translation helpful? Give feedback.
-
|
I've also attached a Chinese explanation of the mechanics.
|
Beta Was this translation helpful? Give feedback.
-
|
Good suggestions. |
Beta Was this translation helpful? Give feedback.
-
|
Only this API /v1/document/get has security issue. Because it's used for the embedded iframe shared by the user which means the third party systems can directly show the chat together with the document preview if the author of the dataset share the page. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks both for the thoughtful replies — I think this helps clarify that we’re actually discussing product-level access semantics, not just API auth mechanics. About the embedded iframe scenario (reply to @KevinHuSh ) For the iframe case where users are not required to log in: If an embedded chat dialog (with document preview) is accessible without login, then effectively: access is still being granted, just not via user identity, but via some form of shared capability. In internal environments, “no login” is acceptable only if the resource is explicitly defined as: public, or shared with a clearly scoped, auditable, and revocable mechanism. Otherwise, unrestricted iframe access is indistinguishable from content leakage during security review. About /v1/document/get being used for sharing (reply to @yingfeng ) I agree this endpoint is special and tied to the shared iframe experience. Right now, the security assumption seems to be: “If a dataset author shares a page, the document API can be open.” From a risk-control standpoint, this becomes much clearer if reframed as: sharing issues a scoped share token (or equivalent), that token is explicitly intended for iframe / third-party embedding, /v1/document/get validates that capability, rather than being globally unauthenticated. This way: the API is not “open” by default, the iframe experience remains smooth, and enterprise deployments can clearly explain why a given request is allowed. Why I proposed the Nginx + proxy approach The original suggestion was meant as a non-invasive deployment-layer workaround, because: the codebase is evolving fast, and enterprises often need something they can deploy now without forking core logic. Long term, a first-class “share access” mechanism (token, scope, expiry) inside RAGFlow feels like the clean solution. Happy to continue the discussion — I think we’re circling the same goal: |
Beta Was this translation helpful? Give feedback.
-
|
We've got some solution and will apply it to the repo asap. All API requests should not be accessed without authentication. |
Beta Was this translation helpful? Give feedback.
-
|
*邮件总结 (Email Summary):*
Hi Yingfeng and Team,
Thank you for the fast response and for implementing the fix! We are
pleased to hear that version 0.24 has already addressed this security
issue, and we will actively verify these changes on our end.
Given that the Chinese New Year is approaching, are there any plans to roll
out a new minor version, such as 0.24.1, before the holiday?
Best regards,
郑迟
Yingfeng ***@***.***> 于 2026年2月11日周三 14:51写道:
… We've got some solution and will apply it to the repo asap. All API
requests should not be accessed without authentication.
只有官方才能做的更好更快!很高兴能参与谈论,新年快乐。
Latest 0.24 has fixed this issue already. All APIs are required to be
authenticated at first.
—
Reply to this email directly, view it on GitHub
<#13015 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A44KAOUSB4GB77FTGUJ7OMD4LLGNZAVCNFSM6AAAAACUB2VOZWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKNZWGQ4TOMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
As the Chinese New Year approaches, we have no plans to release 0.24.1. Version 0.24 is not a release with significant updates. Moving forward, our focus will be on evolving toward 0.25. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Title
Security discussion: Unauthenticated /v1/* endpoints + proposed non-invasive mitigation
Body
Hi RAGFlow team, thanks for building such a solid project — we're actively evaluating it for deployment in a corporate intranet environment.
During our internal security assessment for intranet Docker deployment, we noticed that some endpoints (e.g.
/v1/document/getand similar document-related APIs) can be accessed without authentication when the service port is exposed. This has already triggered alerts in our security scanning tools, and may lead to unintended data exposure (documents, metadata, or other resources depending on the deployment).Our Use Case
We're deploying RAGFlow as a Docker-based service in our corporate intranet to support internal knowledge management workflows. As part of our security compliance process, we need to work with our security department to address vulnerabilities flagged during automated scans. While we understand the project is evolving quickly and there may be compatibility reasons (e.g. supporting
<img>calls or other integration constraints) that led to relaxing auth on these endpoints, from a deployment standpoint this is a latent security risk: once the scanner detects an unrestricted port + unauthenticated sensitive APIs, it becomes difficult to pass internal review even if the project itself is excellent.Questions (to understand the context)
(cc: @RAGFlow_TS_xjx and @虞礼瑞 for WCG 491 — I'm trying to understand the original trade-offs.)
A non-invasive mitigation idea (Nginx + small proxy)
Given the codebase is under rapid development, we'd like to avoid invasive changes inside RAGFlow. A deployment-level mitigation could work like this:
POST /v1/user/loginreturns a successful response and includes auth information in response headers (e.g.Authorizationappears at this moment).A lightweight proxy service A sits in front of RAGFlow only for the login response path:
Authorization).Set-Cookie: token=<...>; HttpOnly; Secure; SameSite=...(configurable).Then Nginx enforces that all
/v1/*(or at least document-related endpoints) require a valid cookie (or equivalent), and requests without cookie get 401.The cookie presence/validity can be verified via an existing endpoint like
/v1/user/info(auth probe).In other words:
This also fits stricter enterprise network rules: containers don't directly expose the raw service port (e.g. 9380), but are reachable only via Nginx forwarding.
Why this helps enterprise deployment
<img>or other clients that can't easily add custom headers, by relying on cookies.What we've validated so far
Authorizationheader is correctly returned afterPOST /v1/user/login/v1/user/infoendpoint can serve as an auth probeauth_requestmoduleOpen to feedback
This is a working idea, and we'd love to hear:
ps:We have implemented a straightforward approach. If you're interested, feel free to apply for access and read the details at:
Thanks again — our goal is to help make RAGFlow easier to deploy safely in real-world enterprise environments while respecting the project's development velocity and architectural decisions.
Beta Was this translation helpful? Give feedback.
All reactions