Skip to content

Is it safe to use untrusted keywords in HoneySQL maps? #368

Answered by seancorfield
olavfosse asked this question in Q&A
Discussion options

You must be logged in to vote

HoneySQL makes an attempt to prevent injection via such code but you probably shouldn't rely on just that for security:

dev=> (sql/format {:select [(keyword "1; drop table users; select *")] :from :whatever})
Execution error (ExceptionInfo) at honey.sql/format-entity (sql.cljc:237).
suspicious character found in entity: 1; drop table users; select *

Currently, it only detects ; and disallows SQL entities that contain that character.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@olavfosse
Comment options

Answer selected by olavfosse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants