Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(audio_service): validate message_id format using UUID (#12087)

-LAN-a1c78ad9d40f
diff --git a/api/services/audio_service.py b/api/services/audio_service.py
index 973110f5156..ef52301c0ae 100644
--- a/api/services/audio_service.py
+++ b/api/services/audio_service.py
@@ -1,5 +1,6 @@
import io
import logging
+import uuid
from typing import Optional
from werkzeug.datastructures import FileStorage
@@ -122,6 +123,10 @@ class AudioService:
raise e
if message_id:
+ try:
+ uuid.UUID(message_id)
+ except ValueError:
+ return None
message = db.session.query(Message).filter(Message.id == message_id).first()
if message is None:
return None