@@ -114,14 +114,7 @@ $ semgrep scan --config "p/default" --force-color --text --metrics off --disable
114114
115115* [ Restrictions on values] ( https://www.w3schools.com/xml/schema_facets.asp ) .
116116
117- 💻 Useful commands to find type of processing (excludes test related content):
118-
119- ``` shell
120- # Find if input validation is in place into XSD schemas via regular expressions
121- $ grep -F " :pattern" -rn --exclude-dir=test --include=\* .xsd .
122- # Find if input validation is in place into XSD schemas via restriction instructions other than regular expressions
123- $ grep -E " :(enumeration|fractionDigits|length|maxExclusive|maxInclusive|maxLength|minExclusive|minInclusive|minLength|totalDigits)\s+" -rn --exclude-dir=test --include=\* .xsd .
124- ```
117+ 💻 Useful script to identify if input validation is in place: See [ here] ( ../scripts/identify-input-validation-presence.sh ) .
125118
126119### JavaScript
127120
@@ -175,26 +168,7 @@ grep -Frn "@Matches(" --exclude-dir=test --exclude-dir=node_modules .
175168* [ Apache Commons Lang - Javadoc] ( https://commons.apache.org/proper/commons-lang/apidocs/index.html ) .
176169* [ Java API for XML Processing security guide] ( https://docs.oracle.com/en/java/javase/21/security/java-api-xml-processing-jaxp-security-guide.html ) .
177170
178- 💻 Useful commands to find type of processing (excludes test related content):
179-
180- ``` shell
181- # Find if input validation is in place using beans validation constraints
182- $ grep -E " @(Pattern|Size|Digits|Email|Negative|Positive|Length|Range)" -rn --exclude-dir=test --include=\* .java .
183- # Find if input validation is in place using regex
184- $ grep -F " Pattern" -rn --exclude-dir=test --include=\* .java .
185- # Find if input validation is in place using regex and focusing on regular expressions defined
186- $ grep -F " Pattern.compile(" -rn --exclude-dir=test --include=\* .java .
187- # Find if input validation is in place using Apache Commons-Lang features
188- $ grep -E " \.(isAlpha|isNumeric|isDigits|isParsable)" -rn --exclude-dir=test --include=\* .java .
189- # Find if input validation is in place but limited to the presence of a value
190- $ grep -E " \.(isNull|isEmpty|isBlank|isNotNull|isNotEmpty|isNotBlank|isAllBlank|isAllEmpty|isNoneBlank|isNoneEmpty)" -rn --exclude-dir=test --include=\* .java .
191- # Identify XML processing to check for exposure to XXE
192- $ grep -E " (DocumentBuilderFactory|XMLInputFactory|TransformerFactory|JAXBContext)" -rn --exclude-dir=test --include=\* .java .
193- # Identify cryptography related processing to check for weaknesses in usage/implementation
194- $ grep -E " (MessageDigest|Cipher|ParameterSpec|SecretKey|PrivateKey|PublicKey|KeyGenerator)" -rn --exclude-dir=test --include=\* .java .
195- # Identify system command execution
196- $ grep -F " .exec(" -rn --exclude-dir=test --include=\* .java .
197- ```
171+ 💻 Useful script to identify if input validation is in place: See [ here] ( ../scripts/identify-input-validation-presence.sh ) .
198172
199173💻 Useful commands to find type of files (excludes test related content):
200174
0 commit comments