AOSSIE-Org / AOSSIE-Org/EduAid

Critical: Race condition in /getTranscript causes potential data leaks

オープン
#420 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
171
フォーク
425
PR マージ指標
30日以内にマージされた PR はありません

説明

**Problem**
The `/getTranscript` endpoint currently uses `glob.glob` and `max(key=os.path.getctime)` to identify the downloaded subtitle file.

**The Logic Flaw**
This assumes that the file currently being processed is *always* the newest file in the `subtitles/` directory.
In a concurrent environment (multiple users), if User B's download finishes slightly after User A's download, User A's request thread will incorrectly identify User B's file as the "latest" and return the wrong transcript.

**Impact**
1. **Data Leak:** Users receive transcripts for videos they did not request.
2. **Crash:** If the "latest" file is deleted by another thread before it can be read, the server throws a `FileNotFoundError`.

**Proposed Solution**
Since the filename is deterministic (`subtitles/{video_id}.vtt`), we should explicitly construct the file path using the `video_id` instead of searching the directory.
I am working on a fix for this and will submit a PR shortly.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。