A while ago, I've been experimenting with using Android Studio for refactoring decompiled code.
- Export Java sources, from whatever decompiler works
- "Import project" from sources in Android Studio
- Use Shift-Fn-F6 to rename classes, methods etc
Class.forName ZipFile Statement Math.random sendRedirect "SELECT " java.sql.Statement java.sql.Connection executeQuery Runtime. java.lang.Runtime getRequestURI java.sql BeanUtils.setProp java.lang.reflect
...
htmlEncode
...others skipped...
Filters
Being a Webwork2 webapp, Confluence utilises a number of filters and interceptors. You can get a list of filters your application uses with something like
grep -Rh --include=*.xml "<filter-name" . |sed -e 's/<filter-name>//'|sed -e 's/<\/filter-name>//'|sed -e 's/^[ \t]*//' |sort |uniqReview the list and decide which ones have important security function. Monitor any change mentioning interceptors (both in web.xml files and for any change of their source)
HeaderSanitisingFilter SecurityFilter ... SafeParametersInterceptor PermissionCheckInterceptor ...
grep
-Rh --include=*.java
"^\s\+@"
. |
sed
-e
's/^[ \t]*//'
|
sort
|
uniq
@AnonymousAllowed
|
adding
|
@GET
|
adding
|
@POST
|
adding
|
@HttpMethodRequired
|
any change
|
@ParameterSafe
|
removal
|
@Path
|
adding
|
@RequireSecurityToken
|
removal
|
... |
"<action name" ...
<filter-name>header-sanitiser <filter-name>request-param-cleaner <filter-name>login
<interceptor-ref name="params"/> <interceptor-ref name="permissions"/> <interceptor-ref name="xsrfToken"/>
<interceptor-stack name
...
confluence-core/confluence-webapp/src/main/webapp/WEB-INF/web.xml confluence-core/confluence/src/etc/standalone/tomcat/web.xml confluence-core/confluence/src/java/com/atlassian/confluence/security/login/* confluence-core/confluence/src/java/com/atlassian/confluence/rpc/auth/* confluence-core/confluence/src/java/com/atlassian/confluence/security/* ...
Monitoring for any web.xml changes is probably an overkill, you will catch interesting stuff with the items from other sections above).
![]() |
Configuring custom code inspections in IDEA |