class
Analyzer::Java::Jsp
- Analyzer::Java::Jsp
- Analyzer
- Reference
- Object
Defined in:
analyzer/analyzers/java/jsp.crConstant Summary
-
INTERNAL_ATTRIBUTE_PREFIXES =
["javax.servlet.", "jakarta.servlet.", "javax.faces.", "jakarta.faces.", "org.springframework.", "org.apache.", "org.eclipse.jetty.", "org.glassfish.", "com.sun.", "weblogic.", "io.undertow."] -
Container- and framework-managed request attributes. These are populated by the servlet engine, filters or the MVC layer — never by user input — so
request.getAttribute("javax.servlet....")must not be reported as a request parameter. -
SERVLET_DO_METHOD_PATTERNS =
{"Get" => "GET", "Post" => "POST", "Put" => "PUT", "Delete" => "DELETE", "Patch" => "PATCH", "Head" => "HEAD", "Options" => "OPTIONS"}.map do |suffix, method| {method, /\bvoid\s+do#{suffix}\s*\(([^)]*)\)\s*(?:throws[^{]+)?\{/m} end -
Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile). The
doGet/doPost/... probe set is fixed, so precompile it once at load time. -
WEBAPP_ROOT_MARKERS =
["src/main/webapp/", "src/main/resources/META-INF/resources/", "WebContent/", "WebRoot/"] -
A JSP is served relative to the WEB application root, not the repo root.
src/main/webapp/jsp/index.jspis reachable at/jsp/index.jsp, so strip the build-layout webapp-root prefix; otherwise the whole source path (/libraries-otel/.../src/main/webapp/index.jsp) leaked into the URL.
Instance Method Summary
- #allow_patterns
- #analyze
- #extract_params(content : String) : Array(Param)
- #internal_servlet_attribute?(name : String) : Bool