[DEV-15416] CSV header names interpolated into CREATE TABLE - #4712
Open
DavidMikolaKC wants to merge 7 commits into
Open
[DEV-15416] CSV header names interpolated into CREATE TABLE #4712DavidMikolaKC wants to merge 7 commits into
DavidMikolaKC wants to merge 7 commits into
Conversation
sethstoudenmier
requested changes
Jul 31, 2026
| # checks to see if the column is an expected value | ||
| approved_cols = [c for c in columns if c in self._columns_mapper.keys()] | ||
|
|
||
| if len(approved_cols) > 0: |
Contributor
There was a problem hiding this comment.
Shouldn't this check that the length of the approved_cols is equal to the length of the supplied columns? Otherwise, it will attempt to process if only a single column is approved.
sethstoudenmier
previously approved these changes
Aug 3, 2026
zachflanders-frb
approved these changes
Aug 3, 2026
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.
Description:
When creating new population data tables using incoming treasury csv files, the default headers are passed directly into a create_table command without any processing. While unlikely, checks should be added to account for the possibility of receiving a compromised file.
Technical Details:
loaders.py:75 interpolates each CSV header c as f"{c} TEXT" into a CREATE TABLE statement and executes it with no identifier quoting or allow-list. A simple allow-list is added using the column mappings present in the loader factories
Requirements for PR Merge:
Explain N/A in above checklist: