IMGIITRoorkee / IMGIITRoorkee/placement-flutter
Stop printing bearer tokens and API bodies to device logs
Nobody has claimed this yet.
- 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 containsBearer <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 acrosslib/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_printlint so they cannot come back.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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