Advertisement
selvalives

Untitled

Aug 26th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. 1.The need of input validation
  2. availability
  3. -dos attacked, crashed, exited, restarted
  4. integrity
  5. -steal,read,change
  6. integrity
  7. -modification to the control flow,execute arbitary commands
  8. 2.Data validation techniques
  9. -preventing attack that happens with invalid inputs
  10. -canonicalization -normalization
  11. -avoid characters that have special meaning
  12. -normal control characters(inputs from keyboard that cannot be printed),
  13. value less than 32 and value higher than 127,
  14. metacharacters(;,&)
  15. -encode known bad, accept exact match, reject known bad, use known good
  16. -use frameworks and apis for validation
  17. -javaframework
  18. -javaapi
  19. -use open source validation frameworks
  20. -example: oVal-validates java objects as per user request
  21. -user servlet filter for incoming request with annotations
  22. 3.Strut1 data validation
  23. -can validate both client and server side
  24. -called commonsvalidator
  25. -avoid duplication form names
  26. -implement strut validator class
  27. -validatorform,validatoractionform....
  28. -implement validate function
  29. -must call super.validate
  30. -enable strut validator in the action form mapping
  31. -check for similar number of fields in the action form and validation form
  32. -validate parameter must be set to true in the action mapping
  33. Strut2
  34. -implements XWork frameworks
  35. -separates the actual validation logic and application code
  36. -can handle both client and server side
  37. 4.Spring data validation
  38. -it uses support method to check if target class can be validated and validate method to validate
  39. -uses the error object to provide information on the errors
  40. -custom validator by using Validator interface for condition based validations-age must be between 18-60
  41. 5.Common input validation errors
  42. -improper sanitization of untrusted data
  43. -leads to SQL injection
  44. 6.Common secure coding practises for input validation
  45. -use preparedstatement
  46. -use StoredProcedures
  47. -use whitelisting and blacklisting
  48. -use getcanonicalpath() instead of getabsolutepath()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement