Remove /topic/file/operation endpoint to fix information disclosure vulnerability#9
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
Remove the showFileOperation() endpoint from HelloController and its associated template strings that exposed server filesystem structure and file contents. Remove the four underlying NIO file operation methods from TopicService (findAllFilesInPathAndSort, findParticularFileInPathAndSort, findParticularFileInPathAndSortWithWalkFunction, readFileWithStreamFunction) and clean up now-unused imports (BufferedReader, IOException, Files, Path, Paths). Co-Authored-By: marcel.schwager <marcel.schwager@codeium.com>
Author
🤖 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:
|
Author
Test Results: Remove
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
GET /topic/file/operationendpoint fromHelloControllerand the four underlying NIO file-operation methods fromTopicService. These methods (findAllFilesInPathAndSort,findParticularFileInPathAndSort,findParticularFileInPathAndSortWithWalkFunction,readFileWithStreamFunction) exposed the server's filesystem structure and file contents to callers — they were Java 8 NIO demos, not business logic.Changes:
showFileOperation()method and its four template stringsBufferedReader,IOException,Files,Path,Paths)Pure deletion — no new code added.
mvn clean compilepasses.Review & Testing Checklist for Human
TopicServicemethods — compilation passed but there may be reflection-based or test references/topic/file/operationor the removed service methods and would now failREADME.mdstill documentsGET /topic/file/operationas an available API — consider whether it should be updated in this PR or a follow-upSuggested test plan: Start the app (
mvn spring-boot:run), confirmGET /topic/file/operationreturns 404, and confirm remaining endpoints (/topic/string/operation,/datetime,/topic) still work.Notes
temp.txtfile in the repo root was only read byreadFileWithStreamFunction()— it may now be dead; consider removing it separately.Link to Devin session: https://app.devin.ai/sessions/441792f3d32f41cf90f3419cd067da3e
Requested by: @marcelschwager-ux