Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get subscribers by email (API) #2311

Open
JonasGruenwald opened this issue Feb 18, 2025 · 2 comments
Open

Get subscribers by email (API) #2311

JonasGruenwald opened this issue Feb 18, 2025 · 2 comments
Labels
question Further information is requested

Comments

@JonasGruenwald
Copy link

JonasGruenwald commented Feb 18, 2025

Hello, I'm looking to fetch a subscriber by email as supplied to my application by users in order to enable a list subscription for an existing user.

I saw the parameter query documented here:
https://listmonk.app/docs/apis/subscribers/#get-apisubscribers

But I don't understand whether interpolating an arbitrary user supplied string into that would open me up to SQL injection, could someone shed some light on that?

*Edited for brevity

@JonasGruenwald JonasGruenwald added the question Further information is requested label Feb 18, 2025
@knadh
Copy link
Owner

knadh commented Feb 20, 2025

Hi @JonasGruenwald. SQL expressions for arbitrarily complex searches is central to listmonk, and it covers all search and filtering scenarios including searching by e-mail. This is fully exposed in the admin view, and is meant for admin functions. listmonk ensures that the expression is read-only before it's executed.

The external input (e-mail string) you're receiving, please validate it before you pass it to the search API.

For a future version, we can consider adding an email param to the query that validate it.

@JonasGruenwald
Copy link
Author

Thanks for clarifying, I guess rather than validating then interpolating I'd really prefer to use something like a parametrized query – but I guess I can just make a query against the listmonk db myself from my application rather than using the API in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants