bug: .taskrc parser silently truncates values containing '=' characters causing silent authentication failures

未關閉
#611 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

  • #612 來自 @Varadraj75 —— 已關閉,未合併
  • #632 來自 @Harsh-dev023 —— 已關閉,未合併

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
dart, flutter

研究方向

閱讀 lib/app/utils/taskserver/parse_taskrc.dart,重點查看第 7-8 行的解析器,然後透過使用包含 '=' 的值設定 TaskServer 來重現問題。當解析後的值保留第一個分隔符之後的所有內容(包括 base64 填充),同時依照描述跳過格式錯誤的行時,工作即告完成。

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

描述

bug
Describe your issue

The .taskrc parser in lib/app/utils/taskserver/parse_taskrc.dart
uses line.split('=') to parse key-value pairs. This causes silent
data truncation for any parameter whose value contains one or more =
characters.

This is a critical bug because base64-encoded certificates and other
taskd parameter values routinely contain = padding characters. When
these values are truncated, authentication silently fails with
absolutely no error shown to the user — making it nearly impossible
to diagnose.

Root Cause:
File: lib/app/utils/taskserver/parse_taskrc.dart
Line: 7-8

The parser does:

.map((line) => line.split('='))

and then blindly extracts pair[0] and pair[1]. When a value contains
= (e.g. base64 padding), split('=') produces 3+ parts — everything
from pair[2] onwards is permanently dropped.

Example:
Input: taskd.certificate=abc123==
split result: ['taskd.certificate', 'abc123', '', '']
Stored: 'abc123' ← trailing == silently lost

Steps to reproduce
  1. Create a .taskrc file containing any parameter whose value includes
    one or more '=' characters, for example:

    taskd.certificate=LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0t==
    
  2. Import this .taskrc into the app during TaskServer configuration setup

  3. Tap "Taskrc file is verified" to inspect the parsed configuration

  4. Observe: everything after the second '=' in the value is silently
    dropped from the stored configuration

What was the expected result?

The parser should split only on the first occurrence of '=' and
preserve the entire remainder of the line as the value.

The correct fix is to replace line.split('=') with a first-occurrence
split:

final index = line.indexOf('=');
if (index == -1) return; // skip malformed lines
final key = line.substring(0, index).trim();
final value = line.substring(index + 1).trim();

This correctly handles all values containing '=' characters including
base64-encoded certificates, credentials, and taskd.trust parameters.

Impact:

  • Any user with base64-encoded certificates in their .taskrc is
    silently affected
  • Directly contributes to the root cause of issue #428 (taskd.trust
    being ignored) since cert fields with '=' padding are dropped before
    reaching the SSL handshake
  • Authentication silently fails with no error surfaced to the user
  • Affects all platforms: Android, Linux, Windows, macOS
Put here any screenshots or videos (optional)

N/A — this is a code-level parser bug reproducible by reading
lib/app/utils/taskserver/parse_taskrc.dart lines 7-8

How can we contact you (optional)

Available on CCExtractor Zulip: Varad Raj Agrawal

Would you like to work on this issue?

Yes

By submitting this issue, I have confirmed that:
  • I have starred the repo ⭐ and watched 👀 it on GitHub and followed the contribution guidelines.
主要語言
Dart
星號
246
分支
184
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CCExtractor/taskwarrior-flutter 的其他 Issue

查看 CCExtractor/taskwarrior-flutter 的全部 Issue

相似的 Issue

更多 Dart Issue

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

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