IMGIITRoorkee / IMGIITRoorkee/placement-flutter

Stop printing bearer tokens and API bodies to device logs

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P1 security
Dominant language
Dart
Stars
3
Forks
10
Avg merge
8d 21h
Merged PRs (30d)
4

Description

Problem

Every GET prints the Authorization header, which contains a live JWT, and the full decoded response body to the device log. Every POST prints its request body and response body. print() is not stripped in release builds, so this goes to logcat on Android and the unified log on iOS.

Anything that can read device logs then harvests a valid session token plus student PII: names, enrolment numbers, emails, phone numbers.

Where

  • lib/services/generic/requestService.dart:11-12 (endpoint and header map, header contains Bearer <jwt>)
  • lib/services/generic/requestService.dart:17 (full response body)
  • lib/services/generic/requestService.dart:29-30, 35-36 (POST request and response bodies)
  • 37 print() calls across lib/ in total

Expected

No credentials and no response bodies in any build's logs.

Fix sketch

  • Delete the header and body prints outright.
  • Route remaining diagnostics through a helper guarded by kDebugMode.
  • Enable the avoid_print lint so they cannot come back.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/services/generic/requestService.dart at the listed GET and POST print calls, then search lib/ for the remaining 37 print() calls. Remove credential and body logging, route any remaining diagnostics through a kDebugMode-guarded helper, and enable the avoid_print lint. Done means no credentials or response bodies appear in any build's logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.