Skip to content

Escape column input in table sum#53

Merged
joshmcrae merged 2 commits into
masterfrom
escape-column-param-in-table-sum
May 5, 2026
Merged

Escape column input in table sum#53
joshmcrae merged 2 commits into
masterfrom
escape-column-param-in-table-sum

Conversation

@jaicarlton

@jaicarlton jaicarlton commented May 4, 2026

Copy link
Copy Markdown
Contributor

From a claude security scan it highlighted that sum($column) in lib/PicoDb/Table.php wasn't using $this->db->escapeIdentifier() for $column input parameter.
Everywhere else there is a $column input parameter is used is escaped.
From commit logs it looks like it existed before and was removed in commit daf9b7404cad3bf559f955193c424580c7799d30 - "Add notLike, between and not between. #15".
This seems like it was unintentional regression.
Unit test added to test fix.
Security update and potential breaking change.

@joshmcrae joshmcrae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @jaicarlton!

@joshmcrae joshmcrae merged commit 8d41dd7 into master May 5, 2026
21 checks passed
@joshmcrae joshmcrae deleted the escape-column-param-in-table-sum branch May 5, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants