Skip to content

✨feat: Add conversation share#3308

Merged
WMC001 merged 5 commits into
developfrom
guojunchao/share_history
Jun 27, 2026
Merged

✨feat: Add conversation share#3308
WMC001 merged 5 commits into
developfrom
guojunchao/share_history

Conversation

@gjc199

@gjc199 gjc199 commented Jun 26, 2026

Copy link
Copy Markdown
image image

@gjc199 gjc199 requested review from Dallas98 and WMC001 as code owners June 26, 2026 07:27
…istory

# Conflicts:
#	deploy/sql/migrations/v2.2.1_0618_add_conversation_share_tables.sql
#	docker/init.sql
Comment thread backend/apps/conversation_share_app.py
gjc199 added 3 commits June 27, 2026 11:21
…istory

# Conflicts:
#	frontend/app/[locale]/chat/components/chatAttachment.tsx
#	frontend/services/conversationService.ts
@WMC001 WMC001 merged commit 53b2d89 into develop Jun 27, 2026
14 of 15 checks passed
@@ -0,0 +1,202 @@
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Missing Auth Check

get_conversation_share_endpoint, download_share_asset_endpoint, preview_share_asset_endpoint have NO authentication checks. Anyone with share_token can access conversations and download assets. Add rate limiting and optional password protection.

@@ -0,0 +1,86 @@
from datetime import datetime

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Weak Share Token

Share token uses uuid.uuid4().hex + uuid.uuid4().hex[:16]. For public URLs granting file access, use secrets.token_urlsafe(32) for 256 bits of entropy.

@@ -0,0 +1,86 @@
from datetime import datetime

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Asset ID Enumeration

get_share_asset_service validates share_token is active and asset_id exists but asset_ids use same uuid4 pattern. Attacker could enumerate asset_ids across shares.

@@ -0,0 +1,202 @@
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Missing Expire Time Validation

CreateConversationShareRequest accepts expire_time without validation. User could set year 3000 creating permanent shares. Reject expire_time > 1 year and < now.

@@ -0,0 +1,202 @@
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No Share Revocation Endpoint

revoke_conversation_share exists in DB layer but NO API endpoint calls it. Users cannot revoke shares. Add DELETE /share/{share_token} with auth check.

@@ -0,0 +1,202 @@
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Missing Rate Limiting

create_conversation_share_endpoint has no rate limiting. Malicious user could create thousands of shares. Add per-user and per-conversation rate limits.

@@ -0,0 +1,202 @@
import logging

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Snapshot Content Exposure

snapshot_json stores full conversation history returned to unauthenticated users. Ensure sensitive data (API keys, internal URLs, debug info) is filtered before storing.

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.

3 participants