Repository navigation
Verify fee schedule file with PipeRoot.isUnderRoot - #1031
Conversation
new Path(relativeURI.getPath()) treats a multi-segment path as one name, which platform fb_docker_tar now rejects.
There was a problem hiding this comment.
Claude code finding maybe worth a look:
Finding #1 - [Severity: Low] — Error handling — snprc_ehr/src/org/labkey/snprc_ehr/controllers/FeeScheduleController.java:160
Issue: new File(filePath).toPath() can throw InvalidPathException for characters the OS doesn’t allow, such as NUL, or < and | on Windows. In that case, the request bypasses the new NotFoundException handling and returns a 500.
Why it matters: This PR is intended to return a not-found error for invalid paths, but some invalid paths can still result in a 500. The impact is low since this is admin-only and filePath comes from a hidden form field.
Suggestion: Use FileUtil.resolveFile(new File(filePath)), which handles . and .. without converting to a NIO path. isUnderRoot already uses this internally. Another option is to catch InvalidPathException and throw NotFoundException.
Rationale
Keep fee schedule import working with LabKey/platform#8227, which no longer accepts a multi-segment path string passed as a single
Pathpart.Related Pull Requests
Changes