<. Although they may be technically correct, these addresses are of little use if your application will not be able to actually send emails to them. Do not operate on files in shared directories. Of course, the best thing to do is to use the security manager to prevent the sort of attacks you are validating for. The product validates input before it is canonicalized, which prevents the product from detecting data that becomes invalid after the canonicalization step. This is not generally recommended, as it suggests that the website owner is either unaware of sub-addressing or wishes to prevent users from identifying them when they leak or sell email addresses. Path traversal also covers the use of absolute pathnames such as "/usr/local/bin", which may also be useful in accessing unexpected files. For instance, the name Aryan can be represented in more than one way including Arian, ArYan, Ar%79an (here, %79 refers the ASCII value of letter y in hex form), etc. When designing regular expression, be aware of RegEx Denial of Service (ReDoS) attacks. Defense Option 4: Escaping All User-Supplied Input. The getCanonicalPath() method throws a security exception when used in applets because it reveals too much information about the host machine. Fix / Recommendation: Proper validation should be used to filter out any malicious input that can be injected into a frame and executed on the user's browser, within the context of the main page frame. That rule may also go in a section specific to doing that sort of thing. Special file names such as dot dot (..) are also removed so that the input is reduced to a canonicalized form before validation is carried out. String filename = System.getProperty("com.domain.application.dictionaryFile");