Yes, they are both equally susceptible to injection attacks if you do something in accordance with concatenating user inputs using a GQL string.
However, if you follow Googleβs guidelines for using parameters when entering values ββin a GQL string, you should be fine with GQL. Therefore, instead of:
query = GqlQuery("SELECT * FROM Song WHERE composer = 'Lennon, John'")
you can use:
query = GqlQuery("SELECT * FROM Song WHERE composer = :1", "Lennon, John")
or
query = GqlQuery("SELECT * FROM Song WHERE composer = :composer", composer="Lennon, John")
In addition, you completely avoid this problem by using the request class to generate the request.
yydl
source share