Fix: Unauthenticated /api/tracking endpoints expose client IP addresses and request metadata - #311
WesternConcrete wants to merge 4 commits into
Conversation
…ery values Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
||
| @RestController | ||
| @RequestMapping(path = "/api/tracking") | ||
| @ConditionalOnProperty(name = "ftgo.api-tracking.logs-endpoint.enabled", havingValue = "true") |
There was a problem hiding this comment.
There was a problem hiding this comment.
Correct, and intentional for this PR: the repo has no Spring Security dependency or filter chain anywhere, so real authorization on /api/tracking means introducing an auth stack for the whole monolith — larger than this remediation. This PR removes the default exposure path (endpoints absent from the bean graph unless explicitly enabled) and strips the caller-identifying fields from what those endpoints could return. Happy to follow up with a Spring Security PR gating /api/tracking/** if you want that scope.
| redactQueryString(request.getQueryString()), | ||
| anonymizeAddress(request.getRemoteAddr()), | ||
| request.getHeader("User-Agent") |
There was a problem hiding this comment.
Kept deliberately: User-Agent identifies the client software, not the individual, and it is the remaining field that makes the request log useful for triage once the IP is anonymized and query values are redacted. The NS-relevant identifiers (client IP, consumer/order ids in query strings) are the ones this PR removes. Say the word if you want the header dropped or truncated too and I'll add it.
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Summary
Finding: Unauthenticated /api/tracking endpoints expose client IP addresses and request metadata (COMPLIANCE / NS terms — data egress + access path) in COG-GTM/ftgo-monolith.
The app ships no Spring Security filter chain, so all five
/api/trackingread endpoints were reachable by any caller and returned per-request client IPs, query strings (consumer/order identifiers) and User-Agents fromapi_request_log. Fix closes both the access path and the retention of the personal data itself:The controller is now absent from the bean graph unless the deployment explicitly opts in, and the interceptor keeps its diagnostic value (parameter names, network prefix, latency, status) without retaining caller-identifying data. Verified with
./gradlew :ftgo-common:compileJava.Link to Devin session: https://app.devin.ai/sessions/7c734a49fa1849bc9ef496bfc9c72d10
Open in Devin Desktop: https://app.devin.ai/desktop/session/7c734a49fa1849bc9ef496bfc9c72d10?variant=devin
Requested by: @WesternConcrete
Devin Review