A3:2021 | Cross Site Scripting Mitigation (6) |
Stored XSS
public class MyCommentDAO {
public static void addComment(int threadID, int userID, String newComment) {
String sql = "INSERT INTO COMMENTS(THREADID, USERID, COMMENT) VALUES(?,?,?);";
try {
PreparedStatement stmt = connection.prepareStatement(sql);
stmt.setInt(1, threadID);
stmt.setInt(2, userID);
stmt.setString(3, newComment);
stmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
}It is your turn!


PreviousA3:2021 | Cross Site Scripting Mitigation (5) | Cycubix DocsNextA3:2021 | Path Transversal | Cycubix Docs
Last updated
Was this helpful?

