Are SQL injection attacks possible in JPA?

前端 未结 4 785
滥情空心
滥情空心 2020-12-08 04:05

I\'m building a Java Web Application using Java EE 6 and JSF-2.0, using the persistence API for all database operations.

The back-end is MySQL, but I have used the

4条回答
  •  旧巷少年郎
    2020-12-08 04:52

    If your JPA provider processes all input arguments to handle injection attacks then you should be covered. We do thin in EclipseLink.

    As the previous poster mentioned piecing together your own JPQL or SQL (for native queries) could expose you.

    I would recommend using named queries with parameters over concatenating strings to build JPQL/SQL.

    Doug

提交回复
热议问题