[#12048] SQL injection test for FeedbackQuestionsDbIT
Part of #12048. Test for SQL injections in FeedbackQuestions database methods.
Tests not created for the following db methods as they do not accept string params (so they're type-checked at compile time):
getFeedbackQuestiongetFeedbackQuestionsForSessiongetFeedbackQuestionsForGiverType(query uses feedbackSession's id which isUUIDand giverType which isFeedbackParticipantType)deleteFeedbackQuestion
@EuniceSim142 shall we test for the
getFeedbackQuestionsForGiverTypemethod as well? Just pass in aFeedbackSessionthat has injection strings in name / email / etc. I think the other methods that useUUIDdon't need to be tested. Do also fix the lint checks
I don't think this works as having the sqli string in name and email of feedback session won't inject it into the sql query:
cq.select(root)
.where(cb.and(
cb.equal(fqJoin.get("id"), feedbackSession.getId()),
cb.equal(root.get("giverType"), giverType)));
the query only uses giver type and id which are typed, and name and email which contain the sqli are not used in the where clause.
@EuniceSim142 Let's get the checks to pass and resolve the merge conflict before we merge.