AOSSIE-Org / AOSSIE-Org/Ell-ena

No session expiry or idle timeout in Flutter auth module - stolen device gives permanent authenticated access

未關閉
#308 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Dart
星號
54
分支
110
PR 合併指標
30 天內沒有已合併 PR

描述

## Problem

The Flutter auth module (`lib/screens/auth/`) uses Supabase session tokens
that persist indefinitely in device storage. There is no idle timeout, no
session expiry configuration, and no mechanism to force re-authentication
after a period of inactivity.

For a productivity app handling work tasks, tickets, and meeting transcriptions,
a stolen or unlocked device gives the thief permanent, unrevocable access to
all of a user's project data. The user has no way to remotely invalidate the
session from another device unless the Supabase admin manually revokes tokens.

## Impact

- A stolen phone or an unattended unlocked screen gives full access to the
user's tasks, tickets, and meeting recordings indefinitely.
- No in-app session revocation mechanism exists for users to protect themselves.

## Suggested Fix

1. Configure Supabase Auth session settings to enforce a reasonable access
token lifetime (e.g. 1 hour) and refresh token rotation.
2. Implement an idle detection timer in the Flutter app that signs the user
out after a configurable period of inactivity (e.g. 30 minutes).
3. Add a "Sign out all devices" option in the profile screen that calls
`supabase.auth.signOut(scope: SignOutScope.global)` to revoke all active
sessions.
4. Store session tokens using Flutter's `flutter_secure_storage` package
(which uses the platform keychain/keystore) rather than plain shared
preferences.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start by tracing the auth flow under lib/screens/auth/ and locating the profile screen, Supabase session configuration, and current device-storage path. Map where inactivity can be observed and where sign-out is handled; done means the issue's four protections are implemented, including global sign-out and secure token storage, with configurable expiry and idle behavior.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
dart, flutter, supabase
領域
authentication, mobile, security
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。