Skip to content

Conversation

@labkey-bpatel
Copy link
Contributor

Rationale

Secure controller action/API endpoints that might allow unauthorized access to the files on the server by using FileLike instead of File (String) or File (String, String) patterns.

Related Pull Requests

Changes

  • FileLike conversion in FeeScheduleController

@labkey-bpatel labkey-bpatel marked this pull request as ready for review April 14, 2025 16:04
Copy link
Contributor

@Sigmonia Sigmonia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach you took here.

return new JspView<>("/org/labkey/snprc_ehr/pipeline/FeeScheduleImport.jsp", form, errors);
}

private File getVerifiedFile(String filePath)
Copy link
Contributor

@Sigmonia Sigmonia Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkey-matthewb Would it be generally useful to have this a helper method on the Piperoot/PipelineService? Adding either the root or the container as a parameter makes this validation pretty generic for parsing incoming file paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkey-ians I was wondering the same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkey-ians Since @labkey-matthewb is out this week, we can table this discussion and come back to it. In the meantime, I'll merge the PR.

@labkey-bpatel labkey-bpatel merged commit a6a557f into develop Apr 15, 2025
7 checks passed
@labkey-bpatel labkey-bpatel deleted the fb_use_filelike_2 branch April 15, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants