diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java
new file mode 100644
index 000000000..f9ff8a44b
--- /dev/null
+++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java
@@ -0,0 +1,220 @@
+package org.owasp.webgoat.lessons;
+
+import org.owasp.webgoat.session.WebSession;
+
+import org.apache.ecs.Element;
+import org.apache.ecs.ElementContainer;
+import org.apache.ecs.StringElement;
+import org.apache.ecs.html.Div;
+import org.apache.ecs.html.Form;
+import org.apache.ecs.html.Table;
+import org.apache.ecs.html.TR;
+import org.apache.ecs.html.TD;
+import org.apache.ecs.html.Input;
+import org.apache.ecs.html.BR;
+
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.ArrayList;
+
+public class JSONInjection extends LessonAdapter {
+
+ private final static Integer DEFAULT_RANKING = new Integer(30);
+ private final static String TRAVEL_FROM = "travelFrom";
+ private final static String TRAVEL_TO = "travelTo";
+
+ /**
+ * Copyright (c) 2002 Free Software Foundation developed under the
+ * custody of the Open Web Application Security Project
+ * (http://www.owasp.org) This software package is published by OWASP
+ * under the GPL. You should read and accept the LICENSE before you
+ * use, modify and/or redistribute this software.
+ *
+ * @author sherif@macadamian.com
+ * @created December 25, 2006
+ */
+
+ public void handleRequest(WebSession s) {
+
+ try
+ {
+ if(s.getParser().getRawParameter("from", "").equals("ajax"))
+ {
+ String lineSep = System.getProperty("line.separator");
+ String jsonStr = "{" + lineSep +
+ "\"From\": \"Boston\"," + lineSep +
+ "\"To\": \"Seattle\", " + lineSep +
+ "\"flights\": [" + lineSep +
+ "{\"stops\": \"0\", \"transit\" : \"N/A\", \"price\": \"600$\"}," + lineSep +
+ "{\"stops\": \"2\", \"transit\" : \"Newark,Chicago\", \"price\": \"300$\"} " + lineSep +
+ "]" + lineSep +
+ "}" ;
+ s.getResponse().setContentType("text/html");
+ s.getResponse().setHeader("Cache-Control", "no-cache");
+ PrintWriter out = new PrintWriter(s.getResponse().getOutputStream());
+ out.print(jsonStr);
+ out.flush();
+ out.close();
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ Form form = new Form( getFormAction(), Form.POST ).setName( "form" ).setEncType( "" );
+ form.setOnSubmit("check();");
+
+ form.addElement( createContent( s ) );
+
+ setContent(form);
+
+ }
+
+ /**
+ * Description of the Method
+ *
+ * @param s Current WebSession
+ */
+
+ protected Element createContent(WebSession s)
+ {
+ ElementContainer ec = new ElementContainer();
+ String lineSep = System.getProperty("line.separator");
+ String script = "" + lineSep;
+ ec.addElement( new StringElement(script));
+ Table t1 = new Table().setCellSpacing(0).setCellPadding(0).setBorder(0).setWidth("90%").setAlign("center");
+
+ TR tr = new TR();
+
+ tr.addElement( new TD("From: "));
+ Input in = new Input( Input.TEXT , TRAVEL_FROM ,"" );
+ in.addAttribute("onkeyup", "getFlights();");
+ tr.addElement( new TD(in) );
+
+ t1.addElement( tr );
+
+ tr = new TR();
+ tr.addElement( new TD("To: "));
+ in = new Input( Input.TEXT , TRAVEL_TO ,"" );
+ in.addAttribute("onkeyup", "getFlights();");
+ tr.addElement( new TD(in) );
+
+ t1.addElement( tr );
+ ec.addElement(t1);
+
+ ec.addElement(new BR());
+ ec.addElement(new BR());
+ Div div = new Div();
+ div.addAttribute("name", "flightsDiv");
+ div.addAttribute("id", "flightsDiv");
+ ec.addElement(div);
+
+ Input b = new Input();
+ b.setType( Input.SUBMIT );
+ b.setValue( "Submit" );
+ b.setName("SUBMIT");
+ ec.addElement(b);
+
+ Input price2Submit = new Input();
+ price2Submit.setType( Input.HIDDEN);
+ price2Submit.setName("price2Submit");
+ ec.addElement( price2Submit );
+ if (s.getParser().getRawParameter("radio0" , "").equals("on"))
+ {
+ String price = s.getParser().getRawParameter("price2Submit" , "");
+ price = price.replace("$", "");
+
+ if (Integer.parseInt(price) < 600)
+ {
+ makeSuccess(s);
+ }
+ else
+ {
+ s.setMessage("You are close, try to set the price for the non-stop flight to be less than 600$");
+ }
+ }
+ return ec;
+ }
+
+ protected Category getDefaultCategory()
+ {
+ return AbstractLesson.AJAX_SECURITY;
+ }
+
+ protected List getHints()
+ {
+ List
* Congratulations. You have successfully completed this lesson.");
+ out.flush();
+ out.close();
+ return;
+ }
+ else if (s.getParser().getRawParameter( "confirm", "").equals("Transferring"))
+ {
+ s.getResponse().setContentType("text/html");
+ s.getResponse().setHeader("Cache-Control", "no-cache");
+ PrintWriter out = new PrintWriter(s.getResponse().getOutputStream());
+ out.print("
The transaction had been completed successfully.");
+ out.flush();
+ out.close();
+ return;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ Form form = new Form( getFormAction(), Form.POST ).setName( "form" ).setEncType( "" );
+
+ form.addElement( createContent( s ) );
+
+ setContent(form);
+
+ }
+
+ /**
+ * Description of the Method
+ *
+ * @param s Current WebSession
+ */
+
+ protected Element createContent(WebSession s)
+ {
+ ElementContainer ec = new ElementContainer();
+ String lineSep = System.getProperty("line.separator");
+ String script = "" + lineSep;
+
+ ec.addElement( new StringElement(script) );
+ ec.addElement( new H1("Welcome to WebGoat Banking System"));
+ ec.addElement( new BR() );
+ ec.addElement( new H3("Account Summary:"));
+
+ Table t1 = new Table().setCellSpacing(0).setCellPadding(0).setBorder(1).setWidth("70%").setAlign("left");
+ ec.addElement( new BR() );
+ TR tr = new TR();
+ tr.addElement( new TD( new StringElement( "Account Number" ) ));
+ tr.addElement( new TD( new StringElement( "Account Balance" ) ));
+ t1.addElement( tr );
+
+ tr = new TR();
+ tr.addElement( new TD( new StringElement( "007-872108-023" )));
+ tr.addElement( new TD( new StringElement( "11983" )));
+ t1.addElement( tr );
+
+ ec.addElement( t1 );
+ ec.addElement( new BR() );
+ ec.addElement( new BR() );
+
+ ec.addElement( new H3("
Transfer Information:
"));
+ ec.addElement( new BR() );
+
+ t1 = new Table().setCellSpacing(0).setCellPadding(0).setBorder(1).setWidth("70%").setAlign("left");
+
+ tr = new TR();
+ tr.addElement( new TD( new StringElement( "Transfer to Account:" ) ));
+ Input newAccount = new Input();
+ newAccount.setType( Input.TEXT );
+ newAccount.setName( "newAccount" );
+ newAccount.setValue( "" );
+ tr.addElement( new TD( newAccount ));
+ t1.addElement( tr );
+
+ tr = new TR();
+ tr.addElement( new TD( new StringElement( "Transfer Amount:" )));
+ Input amount = new Input();
+ amount.setType( Input.TEXT );
+ amount.setName( "amount" );
+ amount.setValue( 0 );
+ tr.addElement( new TD( amount ));
+ t1.addElement( tr );
+
+ ec.addElement( t1 );
+
+ ec.addElement( new PRE() );
+ Input b = new Input();
+ b.setType( Input.BUTTON );
+ b.setName( "confirm" );
+ b.setValue( "Confirm" );
+ b.setOnClick( "processData();" );
+ ec.addElement( b );
+
+ ec.addElement( new BR());
+ Div div = new Div();
+ div.addAttribute("name", "resultsDiv");
+ div.addAttribute("id", "resultsDiv");
+ div.setStyle("font-weight: bold;color:red;");
+ ec.addElement(div);
+
+ return ec;
+ }
+
+ protected Category getDefaultCategory()
+ {
+ return AbstractLesson.AJAX_SECURITY;
+ }
+
+ protected List getHints()
+ {
+ List
General Goal(s):
-* Your victim is a system that takes an activatation key to allow you to use it. +* Your victim is a system that takes an activatation key to allow you to use it.Lesson Plan Title: How to Perform JSON Injection
+Concept / Topic To Teach:
+This lesson teaches how to perform JSON Injection Attacks. ++How the attacks works: +
+JavaScript Object Notation (JSON) is a simple and effective lightweight data exchange format. JSON can be in a lot of forms such as arrays, lists, hashtables and other data structures. +JSON is widely used in AJAX and Web2.0 application and is favored by programmers over XML because of its ease of use and speed. +However, JSON, like XML is prone to Injection attacks. A malacious attackers can inject the reply from the server and inject some aribtrary values in there. + +General Goal(s):
+ +* You are travelling from Boston, MA- Airport code BOS to Seattle, WA - Airport code SEA.Lesson Plan Title: How to Perform Silent Transactions Attacks.
+Concept / Topic To Teach:
+This lesson teaches how to perform silent transactions attacks. ++How the attacks works: +
+Any system that silently processes transactions using a single submission is dangerous to the client. +For example, if a normal web application allows a simple URL submission, a preset session attack will +allow the attacker to complete a transaction without the user’s authorization. +In Ajax, it gets worse: the transaction is silent; it happens with no user feedback on the page, +so an injected attack script may be able to steal money from the client without authorization. +General Goal(s):
+ +* This is a sample internet banking application - money transfers page.