joana-team / joana Goto Github PK
View Code? Open in Web Editor NEWJoana - Information Flow Control for Java
Joana - Information Flow Control for Java
http://suif.stanford.edu/~livshits/work/securibench-micro/descr.html contains a set of small example programs that could be used to evaluate Joana.
When switching from analysis with exeptions to analysis without one has to reenter all sources and sinks. The interface should try to apply the old sources and sinks whenever possible. Also when updating the source file.
I followed readme.md to compile joana without eclipse. But I got an error when execute mvn verify -DskipTests=true -e
like this:
[INFO] Computing target platform for MavenProject: com.ibm.wala:com.ibm.wala.ide.jdt.test:1.4.4-SNAPSHOT @ D:\Store\document\all_my_work\MLDetectionSrc\joana\contrib\wala\com.ibm.wala.ide.jdt.test\pom.xml
[INFO] Resolving dependencies of MavenProject: com.ibm.wala:com.ibm.wala.ide.jdt.test:1.4.4-SNAPSHOT @ D:\Store\document\all_my_work\MLDetectionSrc\joana\contrib\wala\com.ibm.wala.ide.jdt.test\pom.xml
[INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: com.ibm.wala.ide.jdt.test 1.4.4.qualifier
[ERROR] Missing requirement: com.ibm.wala.ide.jdt.test 1.4.4.qualifier requires 'bundle org.eclipse.jdt.launching.macosx 0.0.0' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: com.ibm.wala:com.ibm.wala.ide.jdt.test:1.4.4-SNAPSHOT @ D:\Store\document\all_my_work\MLDetectionSrc\joana\contrib\wala\com.ibm.wala.ide.jdt.test\pom.xml: See log for details -> [Help 1]
org.apache.maven.MavenExecutionException: Cannot resolve dependencies of MavenProject: com.ibm.wala:com.ibm.wala.ide.jdt.test:1.4.4-SNAPSHOT @ D:\Store\document\all_my_work\MLDetectionSrc\joana\contrib\wala\com.ibm.wala.ide.jdt.test\pom.xml
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:100)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:267)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.tycho.artifacts.DependencyResolutionException: Cannot resolve dependencies of MavenProject: com.ibm.wala:com.ibm.wala.ide.jdt.test:1.4.4-SNAPSHOT @ D:\Store\document\all_my_work\MLDetectionSrc\joana\contrib\wala\com.ibm.wala.ide.jdt.test\pom.xml
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:202)
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:116)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.doResolveDependencies(P2DependencyResolver.java:367)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.resolveDependencies(P2DependencyResolver.java:335)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:117)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
... 14 more
Caused by: org.eclipse.tycho.p2.util.resolution.ResolverException: See log for details
at org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy.resolve(ProjectorResolutionStrategy.java:88)
at org.eclipse.tycho.p2.util.resolution.AbstractResolutionStrategy.resolve(AbstractResolutionStrategy.java:42)
at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies(P2ResolverImpl.java:195)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException
It seems that I can't get bundle org.eclipse.jdt.launching.macosx 0.0.0
from repository. My maven settings like this:
<mirrors>
<!-- 阿里云仓库 -->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>central</id>
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>Central2</id>
<name>Central2</name>
<url>http://repo2.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>Central3</id>
<name>Central3</name>
<url>http://central.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>jboss-public-repository</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
<!-- 插件仓库 -->
<pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<!-- 不下载快照版 -->
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
How to fix it?
The ifc console should allow to export a chop if an information leak was found so that there is any posibility to understand the reason of the leak.
The chop should be a SDG viewable in the graph viewer.
I get an error when i try to build the SDG of a class, like this:
java.lang.ArrayIndexOutOfBoundsException: -1 at com.ibm.wala.ssa.SSAInvokeInstruction.substitudeUses(Unknown Source) at com.ibm.wala.ssa.analysis.TrivialPhiElimination.updateTrivialPhiReferences(Unknown Source) at com.ibm.wala.ssa.analysis.TrivialPhiElimination.perform(Unknown Source) at com.ibm.wala.classLoader.ShrikeIRFactory$1.eliminateTrivialPhis(Unknown Source) at com.ibm.wala.classLoader.ShrikeIRFactory$1.<init>(Unknown Source) at com.ibm.wala.classLoader.ShrikeIRFactory.makeIR(Unknown Source) at com.ibm.wala.ssa.DefaultIRFactory.makeIR(Unknown Source) at com.ibm.wala.ssa.SSACache.findOrCreateIR(Unknown Source) at com.ibm.wala.ipa.callgraph.AnalysisCache.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.cfa.ContextInsensitiveSSAInterpreter.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.cfa.DefaultSSAInterpreter.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.cfa.FallbackContextInterpreter.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.cfa.DelegatingSSAContextInterpreter.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.cfa.DelegatingSSAContextInterpreter.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.impl.ExplicitCallGraph$ExplicitNode.getIR(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.getTargetPointerKey(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.processCallingConstraints(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.processResolvedCall(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.access$200(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder$ConstraintVisitor.visitInvokeInternal(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder$ConstraintVisitor.visitInvoke(Unknown Source) at com.ibm.wala.ssa.SSAInvokeInstruction.visit(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.addBlockInstructionConstraints(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.addNodeInstructionConstraints(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.unconditionallyAddConstraintsFromNode(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.addConstraintsFromNode(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder.addConstraintsFromNewNodes(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.StandardSolver.solveImpl(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.StandardSolver.solve(Unknown Source) at com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder.makeCallGraph(Unknown Source) at edu.kit.joana.wala.core.SDGBuilder.buildCallgraph(Unknown Source) at edu.kit.joana.wala.core.SDGBuilder.run(Unknown Source) at edu.kit.joana.wala.core.SDGBuilder.buildAndKeepBuildArtifacts(Unknown Source) at edu.kit.joana.api.sdg.SDGBuildPreparation.computeAndKeepBuildArtifacts(Unknown Source) at edu.kit.joana.api.sdg.SDGProgram.createSDGProgram(Unknown Source) at edu.kit.joana.api.sdg.SDGProgram.createSDGProgram(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.createSDG(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.createSDG(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.buildSDG(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.access$1600(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole$24.execute(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole$CommandRepository.executeCommand(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.executeAndLogCommand(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.processCommand(Unknown Source) at edu.kit.joana.ui.ifc.wala.console.gui.IFCConsoleGUI$2.run(Unknown Source)
I'm using the basic graphical UI version of JOANA found in https://pp.ipd.kit.edu/projects/joana/.
While building the SDG, I use the default settings of JOANA.
The class that prodcues the error can be found in ScratchSwitch.zip.
The class that produces the error is ScratchSwitchProcessed.
I get ScratchSwitchProcessed by preprocessing ScratchSwitch, which produces no errors on SDG build.
I get an exception when trying to select an annotated entry method in the JOANA CLI verison, like this:
`C:\Users\dogas.jdks\corretto-1.8.0_292\jre\bin\java.exe -Dfile.encoding=windows-1252 -jar C:\Users\dogas\IdeaProjects\TestProj\src\main\resources\joana.ui.ifc.wala.cli.jar -i
joana> classPath sootOutput
joana> entry listAnnotated
: Scratch.main([Ljava/lang/String;)V
: ScratchProcessed.main([Ljava/lang/String;)V
joana> entry select Scratch.main([Ljava/lang/String;)V
entry select Scratch.main([Ljava/lang/String;)joana> java.util.regex.PatternSyntaxException: Unclosed character class near index 33
Scratch.main([Ljava/lang/String;)V
^
at java.util.regex.Pattern.error(Pattern.java:1969)
at java.util.regex.Pattern.clazz(Pattern.java:2562)
at java.util.regex.Pattern.sequence(Pattern.java:2077)
at java.util.regex.Pattern.expr(Pattern.java:2010)
at java.util.regex.Pattern.group0(Pattern.java:2919)
at java.util.regex.Pattern.sequence(Pattern.java:2065)
at java.util.regex.Pattern.expr(Pattern.java:2010)
at java.util.regex.Pattern.compile(Pattern.java:1702)
at java.util.regex.Pattern.(Pattern.java:1352)
at java.util.regex.Pattern.compile(Pattern.java:1028)
at edu.kit.joana.ui.ifc.wala.console.console.Pattern.match(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.Pattern.matchEntryPoint(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.EntryLocator.doSearchForEntryPointAnnotated(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.selectEntryPoint(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole.selectEntryPoint(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.IFCConsole$Wrapper.setEntryPoint(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.ImprovedCLI$EntryPointCommand.select(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at picocli.CommandLine.executeUserObject(CommandLine.java:1762)
at picocli.CommandLine.access$900(CommandLine.java:145)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
at picocli.CommandLine.execute(CommandLine.java:1864)
at edu.kit.joana.ui.ifc.wala.console.console.ImprovedCLI$OuterCommand.runInteractive(Unknown Source)
at edu.kit.joana.ui.ifc.wala.console.console.ImprovedCLI$OuterCommand.run(Unknown Source)
at picocli.CommandLine.executeUserObject(CommandLine.java:1729)
at picocli.CommandLine.access$900(CommandLine.java:145)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2101)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2068)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1935)
at picocli.CommandLine.execute(CommandLine.java:1864)
at edu.kit.joana.ui.ifc.wala.console.console.ImprovedCLI.run(Unknown Source)
at edu.kit.joana.ui.ifc.wala.cli.Main.main(Main.java:40)
`
The class files of the classes im trying to select can be found here: Scratch.zip
I want to perform a taint analysis using Joana, and the sinks I annotate are the SDGNodes with the kind of expression. However, I found that Phi Nodes can not be annotated as source or sink. As the figure showed below.
Moreover, I have also found that the Phi nodes in sdg file seems do not correctly record its position in source code (red block) and bytecode (green block). I wonder that whether this is a special implementation or just a bug in Joana.
Then I studied a specific case, the source code and the sdg file are showed below.
I have noticed that the assigment instructions of variables like max and richer are taken as PHI Nodes (blue block) and they are seperated from the Instructions (red block). However, the original assignment instructions after two if statement instructions are missed (green block). I think that these instructions are likely to be eliminated by copy propagation optimization during the process of converting Java bytecode into sdg file. So I want to cancel this in order to get assigment instructions and annotate them as sink instead of annotating PHI nodes. I wonder whether the joana team is aware of where do they perform the copy propagation and can give me some hints. Thanks a lot!
We do not use the GitHub Bugtracker.
Please use this instead: https://pp.info.uni-karlsruhe.de/joana-bugs/
We may change the url to https://pp.ipd.kit.edu/joana-bugs/ when the ssl certificate has been updated.
Hello!
While trying to set up the project I ran into an issue where com.ibm.wala.cast
didn't compile properly. After reading through the mvn
output, I found out that I was missing a g++
compiler. I think this needs to be clarified in README.md
.
With Ubuntu, I could retrieve a g++ compile with sudo apt install build-essential
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.