CDCgov / prime-reportstream

ReportStream is a public intermediary tool for delivery of data between different parts of the healthcare ecosystem.
https://reportstream.cdc.gov
Creative Commons Zero v1.0 Universal
71 stars 39 forks source link

Ensure JOOQ is serializing fields `sender_ip` and `external_name` in a safe manner and that said values are valid. #14721

Closed jack-h-wang closed 1 month ago

jack-h-wang commented 3 months ago

User Story

As ReportStream, I want inputs from external sources sanitized so that I can be certain data is valid and does not pose a security concern.

Description/Use Case

As a best practice, we should ensure that all database access is sanitized so that unintended consequences cannot occur. We should look at both incoming data when performing writes as well as the methods by which the database is accessed when processing API calls.

Risks/Impacts/Considerations

Dev Notes

Some examples that may need to be addressed:

Acceptance Criteria

Andrey-Glazkv commented 3 months ago

Hey team! Please add your planning poker estimate with Zenhub @adegolier @arnejduranovic @brick-green @david-navapbc @jack-h-wang @jalbinson @JFisk42 @mkalish @thetaurean

david-navapbc commented 3 months ago

This ticket has been updated since it was groomed. The volume of work is greater than was originally pointed.

mkalish commented 3 months ago

I've dropped the 4th ac and the payloadname currently has no expectations for it to be valid filename (in fact it typically would not have an extension)

I've also adjust the sender ip ac since it does not make sense to reject a report if there is an IP issue as the sender wont' have a remediation

mkalish commented 3 months ago

Taking a look at the SQL injection angle: