Using FindBugs to look for vulnerabilities

Today (2015-02-26) in the Developers Forum, @skoussa led a discussion about utilizing FindBugs to evaluate vulnerabilities in the OpenMRS code base. Our plan is to evaluate this tool in comparison to a commercial tool to which Sherif has access.

According to @raff we are running FindBugs already as part of our SonarQube installation at:

If anyone is interested in joining the efforts on evaluating these tools (and learning more about them) please reply to this topic and add your voice here.

Thanks for joining our work team to address these important issues! :trophy:

1 Like

We would like to get installed this set of rules: (there’s a specific plugin for sonar: )


Am interested in being part of the learning and investigation or evaluation team, just to be sure how i need to join, “we shall be joining efforts”, does that mean we shall work together or do personal testing work? i hope to hear more details about how i can be of help in this.

Thanks @michael for this invitation

1 Like

Might be useful to get a test instance to test out the new version 4.5.2 LTS or 5.X and see if they offer any advantages. Also for plugin support it would be useful to get on an LTS release as some of the newer plugin versions don’t support our current release of 4.3.2.

So @ryan or @k_joseph are you interested in installing and testing the plugin for sonar I mentioned above?


Sure @raff, i am interested

@k_joseph, thanks! I sent you credentials to use for You should be able to install the plugin and play with it. You’ll need to build the plugin from

1 Like

@ryan, would you take care of trying to upgrade sonar to the latest version?

Sure, are we in agreement that using the LTS is the best option? I plan on installing 4.5.4 (LTS) unless anyone has objections.

Yes, let’s move to 4.5.4 for now. I looked at projects listed here and there’s just one instance of 5.x. Let’s wait until it gets more mature.

Sonarqube 4.5.4 is now installed. I haven’t updated any of the plugins yet as I see there are a lot of dependencies on other plugins.

1 Like

I had just started downloading 5.1, when i read here of the one you guys had pefereffed, nevertheless i will finish and load my installation which is as of now the latest release. I understand that for now our task is evaluating the tool. Are we going to be reporting any vulnerabilities to JIRA that sonar may have traced down that are of value to look into?

I will be evaluating both the plugin and the standard release!

@ryan, thanks! I’ve updated plugins. Could you please restart sonar for the chanes to take effect?

@k_joseph, yes, we are going to report vulnerabilities in JIRA, but first we have to have the plugin running on Once you get the plugin running on your local instance, please report back examples of issues that it finds for openmrs-core so we can see if they are of any value for us.

I restarted and it crashed on startup, with this error. Looks like we need to get the correct versions of the plugins synced together.

    2015.04.03 13:28:47 ERROR web[o.a.c.c.C.[.[.[/sonar]]  Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugins 'findbugs' and 'java' must have exactly the same version as they belong to the same group.
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease( ~[sonar-update-center-common-1.11.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.setParent( ~[sonar-update-center-common-1.11.jar:na]
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests( ~[sonar-update-center-common-1.11.jar:na]
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential( ~[sonar-server-4.5.4.jar:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init( ~[sonar-server-4.5.4.jar:na]
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start( ~[sonar-server-4.5.4.jar:na]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_75]
        at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.7.0_75]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.7.0_75]
        at java.lang.reflect.Method.invoke( ~[na:1.7.0_75]
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.behaviors.AbstractBehavior.start( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.behaviors.Stored.start( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.DefaultPicoContainer.startAdapters( ~[picocontainer-2.14.3.jar:na]
        at org.picocontainer.DefaultPicoContainer.start( ~[picocontainer-2.14.3.jar:na]
        at org.sonar.api.platform.ComponentContainer.startComponents( ~[sonar-plugin-api-4.5.4.jar:na]
        at org.sonar.server.platform.Platform.startLevel2Container( ~[sonar-server-4.5.4.jar:na]
        at org.sonar.server.platform.Platform.init( ~[sonar-server-4.5.4.jar:na]
        at org.sonar.server.platform.PlatformServletContextListener.contextInitialized( ~[sonar-server-4.5.4.jar:na]
        at org.apache.catalina.core.StandardContext.listenerStart( [tomcat-embed-core-7.0.54.jar:7.0.54]
        at org.apache.catalina.core.StandardContext.startInternal( [tomcat-embed-core-7.0.54.jar:7.0.54]
        at org.apache.catalina.util.LifecycleBase.start( [tomcat-embed-core-7.0.54.jar:7.0.54]
        at org.apache.catalina.core.ContainerBase$ [tomcat-embed-core-7.0.54.jar:7.0.54]
        at org.apache.catalina.core.ContainerBase$ [tomcat-embed-core-7.0.54.jar:7.0.54]
        at [na:1.7.0_75]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [na:1.7.0_75]
        at java.util.concurrent.ThreadPoolExecutor$ [na:1.7.0_75]
        at [na:1.7.0_75]
Caused by: java.util.NoSuchElementException: Unable to find a release of plugin java with version 2.3
        at org.sonar.updatecenter.common.Artifact.getRelease( ~[sonar-update-center-common-1.11.jar:na]
        at org.sonar.updatecenter.common.PluginReferential.getParentRelease( ~[sonar-update-center-common-1.11.jar:na]
        ... 31 common frames omitted

I have reverted the java plugin to allow it to start again.

@ryan, I can’t remember now, but did we try java 3.1? reports it is compatible.

Also sonar needs to be restarted as I needed to uninstall the security rules plugin which is not compatible with the new version of sonar.

I believe so, It looks like when updating to 3.1 it is not updating the included plugins, such as jacoco, findbugs, surefire, squid. Are those included now or do we need to update those separately(Looks like they need to be the exact same version as well)?

Version 2.4 moves Java from being an “ecosystem” of multiple plugins to a single, stand-along plugin that encompasses most of the functionality formerly contained in the ecosystem. Unfortunately, SonarQube’s update center cannot handle the switch gracefully. You may use the update center to download the new version of the plugin. However, you must manually remove the Surefire, JaCoCo, and Squid for Java plugins from $SONARQUBE_HOME/extensions/plugins.

is what says you have to do when upgrading from versions lower than 2.4 (which is ture in our case)

1 Like