Skip to content

Harden DB-GPT service endpoints#3098

Open
m1n9yu3 wants to merge 10 commits into
eosphoros-ai:mainfrom
m1n9yu3:security/harden-agent-file-download
Open

Harden DB-GPT service endpoints#3098
m1n9yu3 wants to merge 10 commits into
eosphoros-ai:mainfrom
m1n9yu3:security/harden-agent-file-download

Conversation

@m1n9yu3

@m1n9yu3 m1n9yu3 commented Jun 6, 2026

Copy link
Copy Markdown

Summary

This PR applies defensive hardening across several DB-GPT service endpoints and helpers:

  • Tightens agent file download path handling and route protection.
  • Restricts plugin hub updates to expected repository URLs.
  • Replaces regex-heavy SQL comment stripping with a linear scanner.
  • Adds route-level user dependencies to sensitive knowledge APIs.
  • Simplifies PDF title matching to avoid pathological regex behavior.
  • Enforces configured API keys consistently for Prompt APIs and v1 user dependencies.
  • Parameterizes datasource configuration SQL and adds regression coverage.
  • Scopes legacy resource file paths to conversation upload directories.
  • Replaces v2 chat app stream regex parsing with linear JSON extraction.

Validation

  • Added focused regression tests for authentication helper behavior.
  • Added focused regression tests for datasource configuration DAO filtering and updates.
  • Added focused regression tests for resource file path scoping.
  • Added focused regression tests for v2 chat app stream parsing.
  • Ran syntax checks for touched Python modules.
  • Ran focused pytest coverage for the new and updated tests.

Notes

This public PR intentionally keeps the description high level. It does not include vulnerability reproduction details.

m1n9yu3 added 4 commits June 6, 2026 23:23
Remove ROOT_PATH from the file download allowlist and resolve relative agent download paths under PILOT_PATH/tmp. Add the same user dependency used by adjacent agent endpoints.
Validate plugin hub repository URLs with urlparse and only allow https://github.com hosts. Add the user dependency to the agent hub update endpoint.
@m1n9yu3 m1n9yu3 changed the title Harden agent file, plugin hub, and editor SQL handling Harden agent, plugin hub, editor SQL, and knowledge API handling Jun 6, 2026
@m1n9yu3 m1n9yu3 changed the title Harden agent, plugin hub, editor SQL, and knowledge API handling Harden agent, plugin hub, editor SQL, knowledge API, and PDF handling Jun 6, 2026
@m1n9yu3 m1n9yu3 changed the title Harden agent, plugin hub, editor SQL, knowledge API, and PDF handling Harden DB-GPT service endpoints Jun 6, 2026
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.

1 participant