[{"data":1,"prerenderedAt":5007},["ShallowReactive",2],{"/blog/how-to-benchmark-security-tools":3,"navigation-en-us":4222,"banner-en-us":4649,"footer-en-us":4659,"blog-post-authors-en-us-Isaac Dawson":4904,"blog-related-posts-en-us-how-to-benchmark-security-tools":4919,"blog-promotions-en-us":4944,"next-steps-en-us":4997},{"id":4,"title":5,"authors":6,"body":8,"category":4201,"date":4202,"description":4203,"extension":4204,"externalUrl":4205,"faq":4205,"featured":4206,"heroImage":4207,"meta":4208,"navigation":4209,"path":4210,"seo":4211,"slug":4215,"stem":4216,"tags":4217,"template":4220,"updatedDate":4205,"__hash__":4221},"blogPosts/en-us/blog/how-to-benchmark-security-tools.md","How to benchmark security tools: a case study using WebGoat",[7],"Isaac Dawson",{"type":9,"value":10,"toc":4098},"minimark",[11,22,25,30,33,49,54,57,61,64,68,83,86,90,93,96,100,103,106,109,113,116,149,152,156,159,199,202,205,209,212,1738,1742,1744,2224,2228,2230,2292,2296,2298,2543,2547,2549,2805,2809,2811,3068,3072,3074,3155,3159,3161,3322,3326,3328,3744,3748,3750,3754,3758,3760,4056,4060,4063,4067,4081,4084],[12,13,14,15,21],"p",{},"As your organization grows, the necessity for having automated security tools be a component of your development pipeline will increase. According to the latest ",[16,17,20],"a",{"href":18,"rel":19},"https://www.bsimm.com/about.html",[],"BSIMM10 study",", full-time security members represented just 1.37% of the number of developers. That's one security team member for every 73 developers. Without automated tooling assisting security teams, vulnerabilities may more easily find their way into production.",[12,23,24],{},"When tasked to compare security tools, having the knowledge to judge a fair benchmark is paramount for success. We're going to take a very in-depth look at WebGoat's lessons in this blog post.",[26,27,29],"h2",{"id":28},"running-a-fair-benchmark","Running a fair benchmark",[12,31,32],{},"There are many factors that need to be taken into consideration when comparing various security tools.",[34,35,36,40,43,46],"ol",{},[37,38,39],"li",{},"Is the tool I am testing right for my organization?",[37,41,42],{},"Do the applications I chose to run the tools against reflect what my organization uses?",[37,44,45],{},"Do the applications contain real security issues in real world scenarios, or are they synthetic?",[37,47,48],{},"Are the results consistent across runs? Are they actionable?",[50,51,53],"h3",{"id":52},"choosing-the-right-tool","Choosing the right tool",[12,55,56],{},"Some tools are developer focused, while others may be tailored to security teams. Highly technical tools built for security teams may give better results, but if it requires domain expertise and significant tuning, it may end up being a worse choice for your organization.\nYour organization may also be more concerned about a tool which can run relatively quickly within your development pipeline. If your developers need results immediately, a SAST or DAST tool which takes hours or days to complete may be next to worthless.",[50,58,60],{"id":59},"choosing-applications","Choosing applications",[12,62,63],{},"It's important when comparing tools that they are run against applications that have been developed in-house or closely mirror what your development teams are creating. A SAST tool that's excellent at finding Java security issues will not necessarily translate to one that's great at finding actionable issues in a NodeJS application. If your organization has a diverse set of languages you should run each tool against applications that reflect those environments.",[50,65,67],{"id":66},"real-world-flaws","Real world flaws",[12,69,70,71,76,77,82],{},"Applications like ",[16,72,75],{"href":73,"rel":74},"https://owasp.org/www-project-webgoat/",[],"WebGoat"," or ",[16,78,81],{"href":79,"rel":80},"https://github.com/OWASP/Benchmark",[],"OWASP's Java Benchmark"," do not represent real world applications. Most vulnerabilities have been purposely injected into very simple data and code flows. The majority of flaws in WebGoat exist in the same Java class where the source of user input is defined. In reality, a large number of security issues will be hidden in nested layers of abstraction or multiple function or method calls. You'll want to ensure your test suite of applications includes real world applications and the tools can traverse these complex flows to find potential flaws.",[12,84,85],{},"Even if a tool is excellent at finding language specific issues, it may or may not support the development team's choice in frameworks. Most SAST tools need to add support for specific frameworks. If the tool supports the language of choice but does not support the particular framework, there will be a higher chance for poor results.",[50,87,89],{"id":88},"are-results-consistent-and-useful","Are results consistent and useful?",[12,91,92],{},"Analysis of applications should be run multiple times – DAST tools in particular have a difficult time with consistency due to the dynamic nature of testing live applications. Ensure each tool is run the same number of times to gather enough data points to make a clear decision.",[12,94,95],{},"Security tools tend to over report issues and this can end up causing alert fatigue and reduce the value of the tool. It's important to tune the tools to reduce the number of non-actionable results. Just pay attention to how much time is required to maintain this tuning effort and be sure to include this in the final decision.",[26,97,99],{"id":98},"webgoat-as-a-benchmarking-target","WebGoat as a benchmarking target",[12,101,102],{},"WebGoat is a known vulnerable application that was built to help developers and people interested in web application security understand various flaws and risks to applications. Over the years it has seen numerous contributions to the lessons and became a de facto standard for learning about web application security.",[12,104,105],{},"Due to the increase in popularity of this project, customers have chosen to rely on using it as a benchmark when assessing the capabilities of various SAST and DAST tools. The purpose of this post is to outline some potential pitfalls when using WebGoat as a target for analysis.",[12,107,108],{},"WebGoat was built as a learning aid, not for benchmarking purposes. Certain methods chosen to demonstrate vulnerability do not actually result in real flaws being implemented in WebGoat. To a human attempting to exercise certain flaws, it may look like they've succeeded in finding an issue. In reality, the WebGoat application just makes it appear like they've discovered a flaw.\nThis can cause confusion when an automated tool is run against WebGoat. To a human, they expect the tool to find a flaw at a particular location. Since a number of lessons include synthetic flaws, the tools will fail to report them.\nFor this post, GitLab's Vulnerability Research Team used the v8.1.0 release of WebGoat, however a number of the issues identified will be applicable to older versions as well.",[26,110,112],{"id":111},"webgoats-architecture","WebGoat's architecture",[12,114,115],{},"The focus of this post is on WebGoat and in particular as a target for benchmarking. The WebGoat repository has grown in size over the years and now includes multiple sub-projects:",[117,118,119,134,137,140,143,146],"ul",{},[37,120,121,122,127,128,133],{},"webgoat-container - This project holds the static content as well as the ",[16,123,126],{"href":124,"rel":125},"https://spring.io/projects/spring-boot",[],"Spring Boot"," Framework's lesson scaffolding. The frontend is built using ",[16,129,132],{"href":130,"rel":131},"https://backbonejs.org/",[],"Backbone.js",".",[37,135,136],{},"webgoat-images - Contains a Vagrant file for training purposes.",[37,138,139],{},"webgoat-integration-tests - Contains test files",[37,141,142],{},"webgoat-lessons - Contains the source and resources for the lessons.",[37,144,145],{},"webgoat-server - The primary entry point for the SpringBootApplication.",[37,147,148],{},"webwolf - An entirely separate project for assisting users in exploiting various lessons.",[12,150,151],{},"When building the WebGoat target application, the webgoat-container, webgoat-server and webgoat-lessons are all included into a single SpringBoot server packaged as a JAR artifact.\nFor the most part, lessons that contain legitimate flaws exist in a single class file. Certain SAST tools which implement extensive taint tracking capabilities may not be fully exercised. The end result being, SAST tools with limited capabilities will find just as many flaws as more advanced tools that can handle intra-procedural taint flows. It would be better to benchmark these tools against relatively complex applications versus comparing them with WebGoat's simplistic flaws.",[26,153,155],{"id":154},"analysis-methodology","Analysis methodology",[12,157,158],{},"Only the webgoat-container, webgoat-server and webgoat-lessons projects are included in our analysis of WebGoat for SAST/DAST tools. The other projects webgoat-images, webgoat-integration-tests and webwolf are not included.\nOur analysis follows the lessons and attempts to identify in the source where the flaws, if any, exist. If a lesson is a description or does not process user input, it is not included in the flaw category listing below.\nEach lesson is broken down to cover the following:",[117,160,161,164,167,170,173,176,193,196],{},[37,162,163],{},"Flaw category",[37,165,166],{},"Lesson with title",[37,168,169],{},"Link as viewable from a browser",[37,171,172],{},"Source",[37,174,175],{},"Lesson's purpose - Relevant source code",[37,177,178,179],{},"Whether DAST/SAST would be able to find and the probability level\n",[117,180,181,184,187,190],{},[37,182,183],{},"Possible: A DAST/SAST tool should be able to find the flaw with little to no configuration changes or custom settings",[37,185,186],{},"Probable: A DAST/SAST tool could find the flaw with some configuration changes or custom settings",[37,188,189],{},"Improbable: A DAST/SAST tool most likely will not be able to find the flaw, due to either hardcoded values or other conditions that are not realistic",[37,191,192],{},"Impossible: A DAST/SAST tool would not be able to find any flaw due to it being completely synthetic or other unrealistic circumstances",[37,194,195],{},"Reasoning why it can or can't be found with a SAST or DAST tool",[37,197,198],{},"Example attack where applicable.",[12,200,201],{},"In many places there are additional flaws that exist in the code but are not part of the lesson; we will highlight some of these but not exhaustively.",[12,203,204],{},"Please note this post contains spoilers, if you are new to WebGoat as a learning tool and wish to use it for study, it is recommended to do that first before reading our analysis.",[26,206,208],{"id":207},"a1-injection","(A1) Injection",[210,211],"hr",{},[213,214,215,220,224,235,241,246,249,259,265,270,275,280,283,288,295,305,307,311,318,323,327,330,336,340,344,348,352,355,359,364,376,378,382,389,394,398,401,407,411,415,419,423,426,430,433,442,444,448,455,460,464,467,473,478,482,487,491,494,498,500,502,506,513,518,522,525,529,533,537,541,544,548,550,552,556,563,568,572,575,581,585,589,594,598,605,609,624,629,646,648,652,659,664,668,675,681,685,689,693,697,708,712,718,722,729,731,735,742,747,751,754,760,764,768,772,776,785,789,792,796,808,810,814,821,826,830,833,839,843,847,851,855,861,865,873,877,887,889,893,900,905,909,912,918,922,926,930,934,937,941,944,948,955,957,961,968,973,977,980,986,990,994,998,1002,1007,1011,1018,1022,1029,1031,1035,1042,1047,1051,1054,1060,1064,1068,1072,1076,1081,1085,1090,1094,1101,1103,1107,1114,1119,1124,1129,1135,1139,1143,1147,1151,1172,1176,1183,1187,1194,1196,1200,1207,1212,1216,1228,1234,1238,1242,1246,1250,1265,1269,1276,1280,1287,1289,1293,1300,1305,1310,1316,1320,1324,1328,1332,1339,1343,1350,1354,1361,1363,1367,1374,1379,1384,1389,1395,1399,1403,1408,1412,1428,1458,1462,1466,1473,1478,1482,1491,1497,1502,1506,1510,1514,1524,1540,1543,1547,1554,1559,1563,1572,1578,1584,1588,1592,1596,1600,1614,1630,1633,1637,1644,1648,1652,1671,1677,1681,1685,1689,1693,1704,1708,1726,1736],"details",{},[216,217,219],"summary",{"markdown":218},"span","Findings",[50,221,223],{"id":222},"a1-injection-sql-injection-intro-what-is-sql","(A1) Injection > SQL Injection (intro) > What is SQL?",[12,225,226,230,231],{},[227,228,229],"strong",{},"Link:"," ",[232,233,234],"code",{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/1",[12,236,237,240],{},[227,238,239],{},"Source:"," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson2.java",[12,242,243],{},[227,244,245],{},"Lesson:",[12,247,248],{},"This lesson is for practicing raw SQL queries – it allows anyone to run full SQL queries without parameterized statements.",[250,251,257],"pre",{"className":252,"code":254,"language":255,"meta":256},[253],"language-text","webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson2.java#L55-65\npublic AttackResult completed(@RequestParam String query) {\n    return injectableQuery(query);\n}\n\nprotected AttackResult injectableQuery(String query) {\n    try (var connection = dataSource.getConnection()) {\n        Statement statement = connection.createStatement(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY);\n        ResultSet results = statement.executeQuery(query);\n        StringBuffer output = new StringBuffer();\n\n        results.first();\n        ...\n","text","",[232,258,254],{"__ignoreMap":256},[12,260,261,264],{},[227,262,263],{},"Can SAST Find?"," - Possible",[12,266,267],{},[227,268,269],{},"Can DAST Find?",[117,271,272],{},[37,273,274],{},"Probable",[12,276,277],{},[227,278,279],{},"SAST Reasoning:",[12,281,282],{},"It should be relatively straightforward for a SAST tool to identify that the query comes from a known source (line 55) and is used in a statement's executeQuery method.",[12,284,285],{},[227,286,287],{},"DAST Reasoning:",[12,289,290,291,294],{},"While it should not be difficult for a DAST tool to find such a vulnerability, most DAST tools are not built with attack strings that attempt direct SQL queries. DAST SQL Injection tests are almost always trying to inject into the middle of an already existing SQL query. There is a good chance most DAST tools will not find the ",[232,292,293],{},"/SqlInjection/attack2"," endpoint's query parameter vulnerable.",[12,296,297,300,301,304],{},[227,298,299],{},"Example Attack:"," - ",[232,302,303],{},"query=(SELECT repeat('a',50000000) from information_schema.tables)"," will take ~3 seconds to complete.",[210,306],{},[50,308,310],{"id":309},"a1-injection-sql-injection-intro-data-manipulation-language-dml","(A1) Injection > SQL Injection (intro) > Data Manipulation Language (DML)",[12,312,313,230,315],{},[227,314,229],{},[232,316,317],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/2",[12,319,320,322],{},[227,321,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson3.java",[12,324,325],{},[227,326,245],{},[12,328,329],{},"This lesson is for practicing raw SQL queries – it allows anyone to run UPDATE/INSERT SQL queries without parameterized statements.",[250,331,334],{"className":332,"code":333,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson3.java#L56-65\n\npublic AttackResult completed(@RequestParam String query) {\n    return injectableQuery(query);\n}\n\nprotected AttackResult injectableQuery(String query) {\n    try (Connection connection = dataSource.getConnection()) {\n        try (Statement statement = connection.createStatement(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY)) {\n            Statement checkStatement = connection.createStatement(TYPE_SCROLL_INSENSITIVE,\n                    CONCUR_READ_ONLY);\n            statement.executeUpdate(query);\n        ...\n",[232,335,333],{"__ignoreMap":256},[12,337,338,264],{},[227,339,263],{},[12,341,342],{},[227,343,269],{},[117,345,346],{},[37,347,274],{},[12,349,350],{},[227,351,279],{},[12,353,354],{},"It should be relatively straightforward for a SAST tool to identify that the query comes from a known source on line 56 and is used in a statement's executeUpdate method.",[12,356,357],{},[227,358,287],{},[12,360,290,361,294],{},[232,362,363],{},"/SqlInjection/attack3",[12,365,366,300,368,371,372,375],{},[227,367,299],{},[232,369,370],{},"query=insert into employees (first_name) (SELECT repeat('a', 50000000) from employees)"," will take ~2 seconds to error out (where ",[232,373,374],{},"repeat('a', 5)"," takes 200ms).",[210,377],{},[50,379,381],{"id":380},"a1-injection-sql-injection-intro-data-definition-language-ddl","(A1) Injection > SQL Injection (intro) > Data Definition Language (DDL)",[12,383,384,230,386],{},[227,385,229],{},[232,387,388],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/3",[12,390,391,393],{},[227,392,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson4.java",[12,395,396],{},[227,397,245],{},[12,399,400],{},"This lesson is for practicing raw SQL queries – it allows anyone to create tables via SQL queries without parameterized statements.",[250,402,405],{"className":403,"code":404,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson4.java#L52-59\n\npublic AttackResult completed(@RequestParam String query) {\n    return injectableQuery(query);\n}\n\nprotected AttackResult injectableQuery(String query) {\n    try (Connection connection = dataSource.getConnection()) {\n        try (Statement statement = connection.createStatement(TYPE_SCROLL_INSENSITIVE, CONCUR_READ_ONLY)) {\n            statement.executeUpdate(query);\n        ...\n",[232,406,404],{"__ignoreMap":256},[12,408,409,264],{},[227,410,263],{},[12,412,413],{},[227,414,269],{},[117,416,417],{},[37,418,274],{},[12,420,421],{},[227,422,279],{},[12,424,425],{},"It should be relatively straightforward for a SAST tool to identify that the query comes from a known source on line 53 and is used in a statement's executeUpdate method.",[12,427,428],{},[227,429,287],{},[12,431,432],{},"While it should not be difficult for a DAST tool to find such a vulnerability, most DAST tools are not built with attack strings that attempt direct SQL injection queries. DAST SQL Injection tests are almost always trying to inject into the middle of an already existing SQL query. There is a good chance most DAST tools will not find the /SqlInjection/attack4 endpoint's query parameter vulnerable to sql injection.",[12,434,435,300,437,371,440,375],{},[227,436,299],{},[232,438,439],{},"query=insert into employees (first_name) (SELECT repeat('a', 50000000) from information_schema.tables)",[232,441,374],{},[210,443],{},[50,445,447],{"id":446},"a1-injection-sql-injection-intro-data-control-language-dcl","(A1) Injection > SQL Injection (intro) > Data Control Language (DCL)",[12,449,450,230,452],{},[227,451,229],{},[232,453,454],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/4",[12,456,457,459],{},[227,458,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5.java",[12,461,462],{},[227,463,245],{},[12,465,466],{},"This lesson is for practicing raw SQL queries – it pretends to allow users to run grant/alter on tables via SQL queries. However, it is not calling any SQL functionality.",[250,468,471],{"className":469,"code":470,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5.java#46-51\n\nString regex = \"(?i)^(grant alter table to [']?unauthorizedUser[']?)(?:[;]?)$\";\nStringBuffer output = new StringBuffer();\n\n// user completes lesson if the query is correct\nif (query.matches(regex)) {\n    output.append(\"\u003Cspan class='feedback-positive'>\" + query + \"\u003C/span>\");\n",[232,472,470],{"__ignoreMap":256},[12,474,475,477],{},[227,476,263],{}," - Impossible",[12,479,480],{},[227,481,269],{},[117,483,484],{},[37,485,486],{},"Impossible",[12,488,489],{},[227,490,279],{},[12,492,493],{},"This is a synthetic vulnerability that does not actually call any database functionality.",[12,495,496],{},[227,497,287],{},[12,499,493],{},[210,501],{},[50,503,505],{"id":504},"a1-injection-sql-injection-intro-what-is-sql-injection","(A1) Injection > SQL Injection (intro) > What is SQL injection?",[12,507,508,230,510],{},[227,509,229],{},[232,511,512],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/5",[12,514,515,517],{},[227,516,239],{}," - Static content only",[12,519,520],{},[227,521,245],{},[12,523,524],{},"This lesson is for practicing SQL Injection query string generation, but does not call any server side functionality.",[12,526,527,477],{},[227,528,263],{},[12,530,531],{},[227,532,269],{},[117,534,535],{},[37,536,486],{},[12,538,539],{},[227,540,279],{},[12,542,543],{},"This lesson does not actually call any server side functionality.",[12,545,546],{},[227,547,287],{},[12,549,543],{},[210,551],{},[50,553,555],{"id":554},"a1-injection-sql-injection-intro-try-it-string-sql-injection","(A1) Injection > SQL Injection (intro) > Try It! String SQL injection",[12,557,558,230,560],{},[227,559,229],{},[232,561,562],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/8",[12,564,565,567],{},[227,566,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5a.java",[12,569,570],{},[227,571,245],{},[12,573,574],{},"This lesson provides a form for testing out SQL Injection against database functionality with the goal of returning all results from a table.",[250,576,579],{"className":577,"code":578,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5a.java#L53-L54\n\npublic AttackResult completed(@RequestParam String account, @RequestParam String operator, @RequestParam String injection) {\n    return injectableQuery(account + \" \" + operator + \" \" + injection);\n...\n\nwebgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5a.java#L57-62\n\nprotected AttackResult injectableQuery(String accountName) {\n    String query = \"\";\n    try (Connection connection = dataSource.getConnection()) {\n        query = \"SELECT * FROM user_data WHERE first_name = 'John' and last_name = '\" + accountName + \"'\";\n        try (Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) {\n            ResultSet results = statement.executeQuery(query);\n    ...\n",[232,580,578],{"__ignoreMap":256},[12,582,583,264],{},[227,584,263],{},[12,586,587],{},[227,588,269],{},[117,590,591],{},[37,592,593],{},"Possible",[12,595,596],{},[227,597,279],{},[12,599,600,601,604],{},"The ",[232,602,603],{},"executeQuery"," method is called from a dynamically concatenated string containing user input.",[12,606,607],{},[227,608,287],{},[12,610,611,612,615,616,619,620,623],{},"The three inputs ",[232,613,614],{},"account",", ",[232,617,618],{},"operator"," and ",[232,621,622],{},"injection"," are all concatenated together and each parameter could technically be used as an attack vector. In this case a DAST tool will most likely suffer from over reporting duplicate flaws, as the three input vectors all end up being used in the same resultant query string.",[12,625,626],{},[227,627,628],{},"Example Attack(s):",[117,630,631,636,641],{},[37,632,633],{},[232,634,635],{},"account=Smith' or 1%3d1--&operator=&injection=",[37,637,638],{},[232,639,640],{},"account=&operator=Smith' or 1%3d1--&injection=",[37,642,643],{},[232,644,645],{},"account=&operator=&injection=Smith' or 1%3d1--",[210,647],{},[50,649,651],{"id":650},"a1-injection-sql-injection-intro-try-it-numeric-sql-injection","(A1) Injection > SQL Injection (intro) > Try It! Numeric SQL injection",[12,653,654,230,656],{},[227,655,229],{},[232,657,658],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/9",[12,660,661,663],{},[227,662,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5b.java",[12,665,666],{},[227,667,245],{},[12,669,670,671,674],{},"This lesson provides a form for testing out SQL Injection when the column type is restricted to numerical values. The goal is to return all results from a table. While the resultant query does make use of prepared statements, it incorrectly concatenates user input for the ",[232,672,673],{},"userid"," column.",[250,676,679],{"className":677,"code":678,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson5b.java#L56-71\n\nString queryString = \"SELECT * From user_data WHERE Login_Count = ? and userid= \" + accountName;\ntry (Connection connection = dataSource.getConnection()) {\n        PreparedStatement query = connection.prepareStatement(queryString, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n        ...\n        ResultSet results = query.executeQuery();\n        ...\n",[232,680,678],{"__ignoreMap":256},[12,682,683,264],{},[227,684,263],{},[12,686,687],{},[227,688,269],{},[117,690,691],{},[37,692,593],{},[12,694,695],{},[227,696,279],{},[12,698,699,700,703,704,707],{},"While the query is correctly used in a PreparedStatement only the ",[232,701,702],{},"Login_Count"," is parameterized, the ",[232,705,706],{},"accountName"," is still dynamically assigned, leading to SQL Injection.",[12,709,710],{},[227,711,287],{},[12,713,714,715,717],{},"DAST tools should attempt to inject into both parameters, and provided the correct attack string is used, should successfully identify that the ",[232,716,673],{}," parameter is vulnerable to SQL Injection.",[12,719,720],{},[227,721,299],{},[117,723,724],{},[37,725,726],{},[232,727,728],{},"login_count=1&userid=1+or+1%3D1",[210,730],{},[50,732,734],{"id":733},"a1-injection-sql-injection-intro-compromising-confidentiality-with-string-sql-injection","(A1) Injection > SQL Injection (intro) > Compromising confidentiality with String SQL injection",[12,736,737,230,739],{},[227,738,229],{},[232,740,741],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/10",[12,743,744,746],{},[227,745,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson8.java",[12,748,749],{},[227,750,245],{},[12,752,753],{},"This lesson provides a form for testing out SQL Injection where the goal is to return all results from a table.",[250,755,758],{"className":756,"code":757,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson8.java#L59-65\n\nString query = \"SELECT * FROM employees WHERE last_name = '\" + name + \"' AND auth_tan = '\" + auth_tan + \"'\";\n\ntry (Connection connection = dataSource.getConnection()) {\n    try {\n        Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\n        log(connection, query);\n        ResultSet results = statement.executeQuery(query);\n...\n",[232,759,757],{"__ignoreMap":256},[12,761,762,264],{},[227,763,263],{},[12,765,766],{},[227,767,269],{},[117,769,770],{},[37,771,593],{},[12,773,774],{},[227,775,279],{},[12,777,600,778,619,781,784],{},[232,779,780],{},"name",[232,782,783],{},"auth_tan"," user supplied values are dynamically assigned to a query string, leading to SQL Injection.",[12,786,787],{},[227,788,287],{},[12,790,791],{},"DAST tools should attempt to inject into both parameters which are valid attack vectors leading to exploitable SQL Injection.",[12,793,794],{},[227,795,299],{},[117,797,798,803],{},[37,799,800],{},[232,801,802],{},"name=&auth_tan=1'+or+1%3D1--",[37,804,805],{},[232,806,807],{},"name=1'+or+1%3D1--&auth_tan=",[210,809],{},[50,811,813],{"id":812},"a1-injection-sql-injection-intro-compromising-integrity-with-query-chaining","(A1) Injection > SQL Injection (intro) > Compromising Integrity with Query chaining",[12,815,816,230,818],{},[227,817,229],{},[232,819,820],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/11",[12,822,823,825],{},[227,824,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson9.java",[12,827,828],{},[227,829,245],{},[12,831,832],{},"This lesson provides a form for testing out SQL Injection where the goal is to modify a users salary.",[250,834,837],{"className":835,"code":836,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson9.java#L61-66\n\nString query = \"SELECT * FROM employees WHERE last_name = '\" + name + \"' AND auth_tan = '\" + auth_tan + \"'\";\ntry (Connection connection = dataSource.getConnection()) {\n    try {\n        Statement statement = connection.createStatement(TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE);\n        SqlInjectionLesson8.log(connection, query);\n        ResultSet results = statement.executeQuery(query);\n...\n",[232,838,836],{"__ignoreMap":256},[12,840,841,264],{},[227,842,263],{},[12,844,845],{},[227,846,269],{},[117,848,849],{},[37,850,593],{},[12,852,853],{},[227,854,279],{},[12,856,600,857,619,859,784],{},[232,858,780],{},[232,860,783],{},[12,862,863],{},[227,864,287],{},[12,866,867,868,619,870,872],{},"DAST tools should attempt to inject into both parameters ",[232,869,780],{},[232,871,783],{}," which are valid attack vectors leading to exploitable SQL Injection.",[12,874,875],{},[227,876,299],{},[117,878,879,883],{},[37,880,881],{},[232,882,802],{},[37,884,885],{},[232,886,807],{},[210,888],{},[50,890,892],{"id":891},"a1-injection-sql-injection-intro-compromising-availability","(A1) Injection > SQL Injection (intro) > Compromising Availability",[12,894,895,230,897],{},[227,896,229],{},[232,898,899],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjection.lesson/12",[12,901,902,904],{},[227,903,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson10.java",[12,906,907],{},[227,908,245],{},[12,910,911],{},"This lesson provides a form for testing SQL Injection where the goal is remove evidence of attacks.",[250,913,916],{"className":914,"code":915,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/introduction/SqlInjectionLesson10.java#L58-63\n\nString query = \"SELECT * FROM access_log WHERE action LIKE '%\" + action + \"%'\";\n\n        try (Connection connection = dataSource.getConnection()) {\n            try {\n                Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n                ResultSet results = statement.executeQuery(query);\n...\n",[232,917,915],{"__ignoreMap":256},[12,919,920,264],{},[227,921,263],{},[12,923,924],{},[227,925,269],{},[117,927,928],{},[37,929,593],{},[12,931,932],{},[227,933,279],{},[12,935,936],{},"The action user supplied values are dynamically concatenated to a query string, leading to SQL Injection.",[12,938,939],{},[227,940,287],{},[12,942,943],{},"DAST tools should attempt to inject into the action_string parameter, leading to exploitable SQL Injection.",[12,945,946],{},[227,947,299],{},[117,949,950],{},[37,951,952],{},[232,953,954],{},"action_string=1'+or+1%3D1--",[210,956],{},[50,958,960],{"id":959},"a1-injection-sql-injection-advanced-try-it-pulling-data-from-other-tables","(A1) Injection > SQL Injection (advanced) > Try It! Pulling data from other tables",[12,962,963,230,965],{},[227,964,229],{},[232,966,967],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjectionAdvanced.lesson/2",[12,969,970,972],{},[227,971,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java",[12,974,975],{},[227,976,245],{},[12,978,979],{},"This lesson is to demonstrate how to extract data from tables other than the one the query was defined to execute against.",[250,981,984],{"className":982,"code":983,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java#L60-67\n\nquery = \"SELECT * FROM user_data WHERE last_name = '\" + accountName + \"'\";\n//Check if Union is used\nif (!accountName.matches(\"(?i)(^[^-/*;)]*)(\\\\s*)UNION(.*$)\")) {\n    usedUnion = false;\n}\ntry (Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n        ResultSet.CONCUR_READ_ONLY)) {\n    ResultSet results = statement.executeQuery(query);\n...\n",[232,985,983],{"__ignoreMap":256},[12,987,988,264],{},[227,989,263],{},[12,991,992],{},[227,993,269],{},[117,995,996],{},[37,997,593],{},[12,999,1000],{},[227,1001,279],{},[12,1003,600,1004,1006],{},[232,1005,706],{}," user supplied value is dynamically assigned to a query string, leading to SQL Injection.",[12,1008,1009],{},[227,1010,287],{},[12,1012,1013,1014,1017],{},"DAST tools should attempt to inject into the ",[232,1015,1016],{},"userid_6a"," parameter, leading to exploitable SQL Injection.",[12,1019,1020],{},[227,1021,299],{},[117,1023,1024],{},[37,1025,1026],{},[232,1027,1028],{},"userid_6a=1'+or+1%3D1--",[210,1030],{},[50,1032,1034],{"id":1033},"a1-injection-sql-injection-advanced-no-title","(A1) Injection > SQL Injection (advanced) > (no title)",[12,1036,1037,230,1039],{},[227,1038,229],{},[232,1040,1041],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjectionAdvanced.lesson/4",[12,1043,1044,1046],{},[227,1045,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionChallenge.java",[12,1048,1049],{},[227,1050,245],{},[12,1052,1053],{},"This lesson is a challenge to attempt to extract data from the database that leads to the attacker being able to login as a different user by executing SQL Injection attacks.",[250,1055,1058],{"className":1056,"code":1057,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionChallenge.java#L63-65\n\nString checkUserQuery = \"select userid from sql_challenge_users where userid = '\" + username_reg + \"'\";\nStatement statement = connection.createStatement();\nResultSet resultSet = statement.executeQuery(checkUserQuery);\n...\n",[232,1059,1057],{"__ignoreMap":256},[12,1061,1062,264],{},[227,1063,263],{},[12,1065,1066],{},[227,1067,269],{},[117,1069,1070],{},[37,1071,593],{},[12,1073,1074],{},[227,1075,279],{},[12,1077,600,1078,1006],{},[232,1079,1080],{},"username_reg",[12,1082,1083],{},[227,1084,287],{},[12,1086,1013,1087,1089],{},[232,1088,1080],{}," parameter with a timing or blind sql injection based attack string, leading to exploitable SQL Injection.",[12,1091,1092],{},[227,1093,299],{},[117,1095,1096],{},[37,1097,1098],{},[232,1099,1100],{},"username_reg='%2b(select+repeat('a', 50000000)+from+information_schema.tables)%2b'&email_reg=asdf&password_reg=asdf&confirm_password_reg=asdf",[210,1102],{},[50,1104,1106],{"id":1105},"a1-injection-sql-injection-mitigation-input-validation-alone-is-not-enough-lesson-9","(A1) Injection > SQL Injection (mitigation) > Input validation alone is not enough!! (Lesson 9)",[12,1108,1109,230,1111],{},[227,1110,229],{},[232,1112,1113],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjectionMitigations.lesson/8",[12,1115,1116,1118],{},[227,1117,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/SqlOnlyInputValidation.java",[117,1120,1121],{},[37,1122,1123],{},"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java",[12,1125,1126,1128],{},[227,1127,245],{},"\nThis lesson demonstrates filtering of user input not being sufficient for protecting against SQL injection attacks. This particular case looks to see if the input string contains a space and returns an error if it does.",[250,1130,1133],{"className":1131,"code":1132,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/SqlOnlyInputValidation.java#L48-L52\n\npublic AttackResult attack(@RequestParam(\"userid_sql_only_input_validation\") String userId) {\nif (userId.contains(\" \")) {\n    return failed(this).feedback(\"SqlOnlyInputValidation-failed\").build();\n}\nAttackResult attackResult = lesson6a.injectableQuery(userId);\n...\n\nwebgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java#56-67\n\npublic AttackResult injectableQuery(String accountName) {\n    String query = \"\";\n    try (Connection connection = dataSource.getConnection()) {\n        boolean usedUnion = true;\n        query = \"SELECT * FROM user_data WHERE last_name = '\" + accountName + \"'\";\n        //Check if Union is used\n        if (!accountName.matches(\"(?i)(^[^-/*;)]*)(\\\\s*)UNION(.*$)\")) {\n            usedUnion = false;\n        }\n        try (Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n                ResultSet.CONCUR_READ_ONLY)) {\n            ResultSet results = statement.executeQuery(query);\n",[232,1134,1132],{"__ignoreMap":256},[12,1136,1137,264],{},[227,1138,263],{},[12,1140,1141],{},[227,1142,269],{},[117,1144,1145],{},[37,1146,593],{},[12,1148,1149],{},[227,1150,279],{},[12,1152,1153,1154,1156,1157,1160,1161,1164,1165,1168,1169,1171],{},"SAST tools would most likely be flag this as a flaw existing under the ",[232,1155,1123],{}," class. The ",[232,1158,1159],{},"SqlOnlyInputValidation.java"," file is calling the same method, but the vulnerability exists in ",[232,1162,1163],{},"SqlInjectionLesson6a.java",". Where the flaw is reported depends on how the SAST tool was designed. For example if the SAST tool is capable of tracking taint across intra-procedural calls it may flag the call to ",[232,1166,1167],{},"lesson6a.injectableQuery(userId)"," on line 52. If the SAST tool was designed to only parse the Abstract Syntax Tree (AST) it may only report the flaw in ",[232,1170,1163],{}," on line 67.",[12,1173,1174],{},[227,1175,287],{},[12,1177,1178,1179,1182],{},"Any input filtering done on potential attack vectors makes it more difficult for DAST tools to identify exploitable issues. There is a chance some DAST tools would not find the ",[232,1180,1181],{},"userid_sql_only_input_validation"," parameter vulnerable to SQL Injection.",[12,1184,1185],{},[227,1186,299],{},[117,1188,1189],{},[37,1190,1191],{},[232,1192,1193],{},"userid_sql_only_input_validation='%2b(SELECT/**/repeat(char(60),50000000)from/**/information_schema.tables)%2b'",[210,1195],{},[50,1197,1199],{"id":1198},"a1-injection-sql-injection-mitigation-input-validation-alone-is-not-enough-lesson-10","(A1) Injection > SQL Injection (mitigation) > Input validation alone is not enough!! (Lesson 10)",[12,1201,1202,230,1204],{},[227,1203,229],{},[232,1205,1206],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjectionMitigations.lesson/9",[12,1208,1209,1211],{},[227,1210,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/SqlOnlyInputValidationOnKeywords.java",[117,1213,1214],{},[37,1215,1123],{},[12,1217,1218,1220,1221,76,1224,1227],{},[227,1219,245],{},"\nThis lesson demonstrates filtering of user input not being sufficient for protecting against SQL Injection attacks. This particular case looks to see if the input string contains ",[232,1222,1223],{},"SELECT",[232,1225,1226],{},"FROM"," keywords and replaces them with empty strings, it additionally checks if the input contains a space and returns an error if it does.",[250,1229,1232],{"className":1230,"code":1231,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/SqlOnlyInputValidationOnKeywords.java#L48-L53\n\npublic AttackResult attack(@RequestParam(\"userid_sql_only_input_validation_on_keywords\") String userId) {\n    userId = userId.toUpperCase().replace(\"FROM\", \"\").replace(\"SELECT\", \"\");\n    if (userId.contains(\" \")) {\n        return failed(this).feedback(\"SqlOnlyInputValidationOnKeywords-failed\").build();\n    }\n    AttackResult attackResult = lesson6a.injectableQuery(userId);\n    ...\n\nwebgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java#56-67\n\npublic AttackResult injectableQuery(String accountName) {\n    String query = \"\";\n    try (Connection connection = dataSource.getConnection()) {\n        boolean usedUnion = true;\n        query = \"SELECT * FROM user_data WHERE last_name = '\" + accountName + \"'\";\n        //Check if Union is used\n        if (!accountName.matches(\"(?i)(^[^-/*;)]*)(\\\\s*)UNION(.*$)\")) {\n            usedUnion = false;\n        }\n        try (Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n                ResultSet.CONCUR_READ_ONLY)) {\n            ResultSet results = statement.executeQuery(query);\n",[232,1233,1231],{"__ignoreMap":256},[12,1235,1236,264],{},[227,1237,263],{},[12,1239,1240],{},[227,1241,269],{},[117,1243,1244],{},[37,1245,593],{},[12,1247,1248],{},[227,1249,279],{},[12,1251,1252,1253,1156,1255,1160,1258,1164,1260,1262,1263,1171],{},"SAST tools would most likely flag this as a flaw existing under the ",[232,1254,1123],{},[232,1256,1257],{},"SqlOnlyInputValidationOnKeywords.java",[232,1259,1163],{},[232,1261,1167],{}," on line 53. If the SAST tool was designed to only parse the Abstract Syntax Tree (AST) it may only report the flaw in ",[232,1264,1163],{},[12,1266,1267],{},[227,1268,287],{},[12,1270,1271,1272,1275],{},"Any input filtering done on potential attack vectors makes it much more difficult for DAST tools to identify exploitable issues. There is a good chance most DAST tools would not find the ",[232,1273,1274],{},"userid_sql_only_input_validation_on_keywords"," parameter vulnerable.",[12,1277,1278],{},[227,1279,299],{},[117,1281,1282],{},[37,1283,1284],{},[232,1285,1286],{},"userid_sql_only_input_validation_on_keywords='%2b(SELselectECT/**/repeat(char(60),50000000)FRfromOM/**/information_schema.tables)%2b'",[210,1288],{},[50,1290,1292],{"id":1291},"a1-injection-sql-injection-mitigation-no-title-lesson-12","(A1) Injection > SQL Injection (mitigation) > (no title) (Lesson 12)",[12,1294,1295,230,1297],{},[227,1296,229],{},[232,1298,1299],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SqlInjectionMitigations.lesson/11",[12,1301,1302,1304],{},[227,1303,239],{}," - webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/Servers.java",[12,1306,1307,1309],{},[227,1308,245],{},"\nThis lesson includes a SQL Injection vulnerability in a column field of a SQL query, which can not be specified by a parameter in a parameterized query. As such, it uses a dynamically generated query string with user input for specifying the column name.",[250,1311,1314],{"className":1312,"code":1313,"language":255,"meta":256},[253],"webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/mitigation/Servers.java#L69-L74\n\n public List\u003CServer> sort(@RequestParam String column) throws Exception {\n    List\u003CServer> servers = new ArrayList\u003C>();\n\n    try (Connection connection = dataSource.getConnection();\n            PreparedStatement preparedStatement = connection.prepareStatement(\"select id, hostname, ip, mac, status, description from servers  where status \u003C> 'out of order' order by \" + column)) {\n        ResultSet rs = preparedStatement.executeQuery();\n        ...\n",[232,1315,1313],{"__ignoreMap":256},[12,1317,1318,264],{},[227,1319,263],{},[12,1321,1322],{},[227,1323,269],{},[117,1325,1326],{},[37,1327,593],{},[12,1329,1330],{},[227,1331,279],{},[12,1333,1334,1335,1338],{},"While the SQL query is a prepared statement, the column field can not be specified as a ",[232,1336,1337],{},"parameter"," in a parameterized query. A SAST tool should identify that the query string is concatenated with user input on line 73.",[12,1340,1341],{},[227,1342,287],{},[12,1344,1345,1346,1349],{},"A DAST tool, if it is able to find the ",[232,1347,1348],{},"/WebGoat/SqlInjectionMitigations/servers"," endpoint, should be able to exploit the column based SQL injection issue.",[12,1351,1352],{},[227,1353,299],{},[117,1355,1356],{},[37,1357,1358],{},[232,1359,1360],{},"/WebGoat/SqlInjectionMitigations/servers?column=(select+repeat('a',50000000)+from+information_schema.tables)",[210,1362],{},[50,1364,1366],{"id":1365},"a1-injection-path-traversal-path-traversal-while-uploading-files","(A1) Injection > Path traversal > Path traversal while uploading files",[12,1368,1369,230,1371],{},[227,1370,229],{},[232,1372,1373],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PathTraversal.lesson/1",[12,1375,1376,1378],{},[227,1377,239],{},"  - webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUpload.java",[117,1380,1381],{},[37,1382,1383],{},"webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadBase.java",[12,1385,1386,1388],{},[227,1387,245],{},"\nThis lesson's goal is to upload a file to overwrite a system file. It uses a common insecure pattern of using user input to generate a file path and supplying the file contents to create a new file.",[250,1390,1393],{"className":1391,"code":1392,"language":255,"meta":256},[253],"webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUpload.java#L31-L32\n\npublic AttackResult uploadFileHandler(@RequestParam(\"uploadedFile\") MultipartFile file, @RequestParam(value = \"fullName\", required = false) String fullName) {\n    return super.execute(file, fullName);\n}\n\nwebgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadBase.java#L41-43\n\nvar uploadedFile = new File(uploadDirectory, fullName);\nuploadedFile.createNewFile();\nFileCopyUtils.copy(file.getBytes(), uploadedFile);\n...\n",[232,1394,1392],{"__ignoreMap":256},[12,1396,1397,264],{},[227,1398,263],{},[12,1400,1401],{},[227,1402,269],{},[117,1404,1405],{},[37,1406,1407],{},"Improbable",[12,1409,1410],{},[227,1411,279],{},[12,1413,1414,1415,1418,1419,230,1422,1425,1426],{},"A SAST tool should be able to identify that the ",[232,1416,1417],{},"new File"," call's second parameter is tainted from the ",[232,1420,1421],{},"uploadFileHandler",[232,1423,1424],{},"fullName"," parameter.\n",[227,1427,287],{},[12,1429,1430,1431,1434,1435,1438,1439,1442,1443,1446,1447,1450,1451,1454,1455,133],{},"DAST tools have difficulties identifying insecure file upload path traversal attacks. As the attack is a two-step process, the tool most likely will not be able to identify where the uploaded file ultimately resides on the file system. The first step is uploading the file, while the second is for identifying where the uploaded file exists and attempting to access it.\nIn this lesson there is no way to retrieve a non ",[232,1432,1433],{},".jpg"," suffixed file. The ",[232,1436,1437],{},"var catPicture = new File(catPicturesDirectory, (id == null ? RandomUtils.nextInt(1, 11) : id) + \".jpg\");"," limits what can be retrieved. Additionally, the only way to attempt to access uploaded files is through a completely unrelated web page. A DAST tool would not understand the relationship between the upload endpoint and the retrieval endpoint.\nWhile it is possible to attempt null byte attacks if the string contains ",[232,1440,1441],{},"path-traversal-secret.jpg"," the ",[232,1444,1445],{},"FileCopyUtils"," method uses ",[232,1448,1449],{},"java.io.File.toPath"," which disallows null bytes. For example attempting the attack: ",[232,1452,1453],{},"/WebGoat/PathTraversal/random-picture?id=%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2fetc%2fpasswd%00path-traversal-secret.jpg%00"," will fail with the error: ",[232,1456,1457],{},"java.nio.file.InvalidPathException: Nul character not allowed",[26,1459,1461],{"id":1460},"given-the-above-while-it-is-possible-to-upload-arbitrary-files-it-is-not-possible-to-access-them-hence-a-dast-tool-would-be-unable-to-identify-this-as-a-flaw-a-human-of-course-could-use-various-techniques-to-attempt-to-overwrite-system-files-but-a-dast-tool-is-not-built-for-such-activities","Given the above, while it is possible to upload arbitrary files, it is not possible to access them, hence a DAST tool would be unable to identify this as a flaw. A human of course could use various techniques to attempt to overwrite system files, but a DAST tool is not built for such activities.",[50,1463,1465],{"id":1464},"a1-injection-path-traversal-path-traversal-while-uploading-files-lesson-3","(A1) Injection > Path traversal > Path traversal while uploading files (lesson 3)",[12,1467,1468,230,1470],{},[227,1469,229],{},[232,1471,1472],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PathTraversal.lesson/2",[12,1474,1475,1477],{},[227,1476,239],{},"  - webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadFix.java",[117,1479,1480],{},[37,1481,1383],{},[12,1483,1484,1486,1487,1490],{},[227,1485,245],{},"\nThis lesson's goal is to upload a file to overwrite a system file. It uses a common insecure pattern of using user input to generate a file path and supply the file contents to create a new file. In this lesson filtering is done on user input, replacing ",[232,1488,1489],{},"../"," with an empty string.",[250,1492,1495],{"className":1493,"code":1494,"language":255,"meta":256},[253],"webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadFix.java#L24-L28\n\n    public AttackResult uploadFileHandler(\n            @RequestParam(\"uploadedFileFix\") MultipartFile file,\n            @RequestParam(value = \"fullNameFix\", required = false) String fullName) {\n        return super.execute(file, fullName != null ? fullName.replace(\"../\", \"\") : \"\");\n    }\n\nwebgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadBase.java#L41-43\n\nvar uploadedFile = new File(uploadDirectory, fullName);\nuploadedFile.createNewFile();\nFileCopyUtils.copy(file.getBytes(), uploadedFile);\n",[232,1496,1494],{"__ignoreMap":256},[12,1498,1499,1501],{},[227,1500,263],{}," - Yes",[12,1503,1504],{},[227,1505,269],{},[117,1507,1508],{},[37,1509,1407],{},[12,1511,1512],{},[227,1513,279],{},[12,1515,1414,1516,1418,1518,230,1520,1425,1522],{},[232,1517,1417],{},[232,1519,1421],{},[232,1521,1424],{},[227,1523,287],{},[12,1525,1430,1526,1434,1528,1438,1530,1442,1532,1446,1534,1450,1536,1454,1538,133],{},[232,1527,1433],{},[232,1529,1437],{},[232,1531,1441],{},[232,1533,1445],{},[232,1535,1449],{},[232,1537,1453],{},[232,1539,1457],{},[26,1541,1461],{"id":1542},"given-the-above-while-it-is-possible-to-upload-arbitrary-files-it-is-not-possible-to-access-them-hence-a-dast-tool-would-be-unable-to-identify-this-as-a-flaw-a-human-of-course-could-use-various-techniques-to-attempt-to-overwrite-system-files-but-a-dast-tool-is-not-built-for-such-activities-1",[50,1544,1546],{"id":1545},"a1-injection-path-traversal-path-traversal-while-uploading-files-lesson-4","(A1) Injection > Path traversal > Path traversal while uploading files (lesson 4)",[12,1548,1549,230,1551],{},[227,1550,229],{},[232,1552,1553],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PathTraversal.lesson/3",[12,1555,1556,1558],{},[227,1557,239],{},"  - webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadRemoveUserInput.java",[117,1560,1561],{},[37,1562,1383],{},[12,1564,1565,1567,1568,1571],{},[227,1566,245],{},"\nThis lessons goal is to upload a file to overwrite a system file. It uses a common insecure pattern of using user input to generate a file path and supplying the file contents to create a new file. In this lesson the filename is taken from the ",[232,1569,1570],{},"MultipartFile.getOriginalFilename()"," which is still user input, as it is possible to modify the filename part of a Multipart upload:",[250,1573,1576],{"className":1574,"code":1575,"language":255,"meta":256},[253],"Content-Disposition: form-data; name=\"uploadedFileRemoveUserInput\"; filename=\"../../test.html\"\n",[232,1577,1575],{"__ignoreMap":256},[250,1579,1582],{"className":1580,"code":1581,"language":255,"meta":256},[253],"webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadRemoveUserInput.java#L24-L28\n\npublic AttackResult uploadFileHandler(\n        @RequestParam(\"uploadedFileFix\") MultipartFile file,\n        @RequestParam(value = \"fullNameFix\", required = false) String fullName) {\n    return super.execute(file, fullName != null ? fullName.replace(\"../\", \"\") : \"\");\n}\n\nwebgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadBase.java#L41-43\n\nvar uploadedFile = new File(uploadDirectory, fullName);\nuploadedFile.createNewFile();\nFileCopyUtils.copy(file.getBytes(), uploadedFile);\n",[232,1583,1581],{"__ignoreMap":256},[12,1585,1586,264],{},[227,1587,263],{},[12,1589,1590],{},[227,1591,269],{},[117,1593,1594],{},[37,1595,1407],{},[12,1597,1598],{},[227,1599,279],{},[12,1601,1414,1602,1604,1605,1607,1608,1611,1612],{},[232,1603,1417],{}," call's second parameter is tainted from the uploadFileHandler fullName parameter, which originates from the ",[232,1606,1570],{}," from ",[232,1609,1610],{},"ProfileUploadRemoveUserInput.java",".\n",[227,1613,287],{},[12,1615,1430,1616,1434,1618,1438,1620,1442,1622,1446,1624,1450,1626,1454,1628,133],{},[232,1617,1433],{},[232,1619,1437],{},[232,1621,1441],{},[232,1623,1445],{},[232,1625,1449],{},[232,1627,1453],{},[232,1629,1457],{},[26,1631,1461],{"id":1632},"given-the-above-while-it-is-possible-to-upload-arbitrary-files-it-is-not-possible-to-access-them-hence-a-dast-tool-would-be-unable-to-identify-this-as-a-flaw-a-human-of-course-could-use-various-techniques-to-attempt-to-overwrite-system-files-but-a-dast-tool-is-not-built-for-such-activities-2",[50,1634,1636],{"id":1635},"a1-injection-path-traversal-retrieving-other-files-with-a-path-traversal","(A1) Injection > Path traversal > Retrieving other files with a path traversal",[12,1638,1639,230,1641],{},[227,1640,229],{},[232,1642,1643],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PathTraversal.lesson/4",[12,1645,1646,1558],{},[227,1647,239],{},[117,1649,1650],{},[37,1651,1383],{},[12,1653,1654,1656,1657,1660,1661,76,1664,1667,1668,1670],{},[227,1655,245],{},"\nThis lesson's goal is to retrieve a particular file from the file system. It uses a rather uncommon method of validating the entire query string via ",[232,1658,1659],{},"request.getQueryString()"," to see if it contains ",[232,1662,1663],{},"..",[232,1665,1666],{},"/",". While technically the call to ",[232,1669,1417],{}," is vulnerable to path traversal attacks, it is not actually an exploitable arbitrary local file inclusion vulnerability. It can only return files which are jpg's, and null-byte attacks are not possible due to calls to FileCopyUtils which validates that the path does not contain null bytes.",[250,1672,1675],{"className":1673,"code":1674,"language":255,"meta":256},[253],"webgoat-lessons/path-traversal/src/main/java/org/owasp/webgoat/path_traversal/ProfileUploadRemoveUserInput.java#L75-94\n\npublic ResponseEntity\u003C?> getProfilePicture(HttpServletRequest request) {\n    var queryParams = request.getQueryString();\n    if (queryParams != null && (queryParams.contains(\"..\") || queryParams.contains(\"/\"))) {\n        return ResponseEntity.badRequest().body(\"Illegal characters are not allowed in the query params\");\n    }\n    try {\n        var id = request.getParameter(\"id\");\n        var catPicture = new File(catPicturesDirectory, (id == null ? RandomUtils.nextInt(1, 11) : id) + \".jpg\");\n\n        if (catPicture.getName().toLowerCase().contains(\"path-traversal-secret.jpg\")) {\n            return ResponseEntity.ok()\n                    .contentType(MediaType.parseMediaType(MediaType.IMAGE_JPEG_VALUE))\n                    .body(FileCopyUtils.copyToByteArray(catPicture));\n        }\n        if (catPicture.exists()) {\n            return ResponseEntity.ok()\n                    .contentType(MediaType.parseMediaType(MediaType.IMAGE_JPEG_VALUE))\n                    .location(new URI(\"/PathTraversal/random-picture?id=\" + catPicture.getName()))\n                    .body(Base64.getEncoder().encode(FileCopyUtils.copyToByteArray(catPicture)));\n        }\n    ...\n",[232,1676,1674],{"__ignoreMap":256},[12,1678,1679,264],{},[227,1680,263],{},[12,1682,1683],{},[227,1684,269],{},[117,1686,1687],{},[37,1688,1407],{},[12,1690,1691],{},[227,1692,279],{},[12,1694,1414,1695,1697,1698,76,1701,1703],{},[232,1696,1417],{}," call's second parameter is tainted. However, the File object is only used in calls to either ",[232,1699,1700],{},"getName()",[232,1702,1445],{}," which validates that the filename does not contain null bytes. So while it's technically vulnerable, it is not exploitable for arbitrary file access.",[12,1705,1706],{},[227,1707,287],{},[12,1709,1430,1710,1434,1712,1714,1715,1442,1717,1446,1719,1721,1722,1454,1724,133],{},[232,1711,1433],{},[232,1713,1437],{}," limits what can be retrieved.\nWhile it is possible to attempt null byte attacks if the string contains ",[232,1716,1441],{},[232,1718,1445],{},[232,1720,1449],{},", which disallows null bytes. For example attempting the attack: ",[232,1723,1453],{},[232,1725,1457],{},[12,1727,1728,1729,76,1732,1735],{},"Given the above, a DAST tool would most likely be unable to identify this as a flaw. Most DAST tools use hardcoded filepaths such as ",[232,1730,1731],{},"/etc/passwd",[232,1733,1734],{},"c:/windows/win.ini"," when attempting to access arbitrary files.",[210,1737],{},[26,1739,1741],{"id":1740},"a2-broken-authentication","(A2) Broken Authentication",[210,1743],{},[213,1745,1746,1748,1752,1759,1764,1769,1774,1780,1784,1788,1792,1796,1799,1802,1806,1810,1814,1821,1826,1839,1845,1850,1854,1858,1862,1879,1885,1887,1891,1898,1903,1912,1918,1922,1926,1930,1934,1945,1949,1952,1954,1958,1965,1970,1974,1977,1983,1988,1992,1996,2000,2005,2009,2013,2020,2025,2034,2040,2044,2048,2052,2056,2062,2066,2069,2073,2081,2087,2095,2097,2101,2108,2113,2117,2120,2126,2130,2134,2138,2142,2146,2149,2153,2156,2158,2162,2169,2174,2179,2183,2186,2192,2196,2200,2204,2208,2211,2215,2222],{},[216,1747,219],{"markdown":218},[50,1749,1751],{"id":1750},"a2-broken-authentication-authentication-bypasses-2fa-password-reset","(A2) Broken Authentication > Authentication Bypasses > 2FA Password Reset",[12,1753,1754,230,1756],{},[227,1755,229],{},[232,1757,1758],{},"http://localhost:8080/WebGoat/start.mvc#lesson/AuthBypass.lesson/1",[12,1760,1761,1763],{},[227,1762,239],{}," - webgoat-lessons/auth-bypass/src/main/java/org/owasp/webgoat/auth_bypass/AuthBypass.java",[117,1765,1766],{},[37,1767,1768],{},"webgoat-lessons/auth-bypass/src/main/java/org/owasp/webgoat/auth_bypass/AccountVerificationHelper.java",[12,1770,1771,1773],{},[227,1772,245],{},"\nThis lesson is for bypassing 2FA password reset by removing POST parameters.",[250,1775,1778],{"className":1776,"code":1777,"language":255,"meta":256},[253],"webgoat-lessons/auth-bypass/src/main/java/org/owasp/webgoat/auth_bypass/AccountVerificationHelper.java#L69-86\n\npublic boolean verifyAccount(Integer userId, HashMap\u003CString, String> submittedQuestions) {\n    //short circuit if no questions are submitted\n    if (submittedQuestions.entrySet().size() != secQuestionStore.get(verifyUserId).size()) {\n        return false;\n    }\n\n    if (submittedQuestions.containsKey(\"secQuestion0\") && !submittedQuestions.get(\"secQuestion0\").equals(secQuestionStore.get(verifyUserId).get(\"secQuestion0\"))) {\n        return false;\n    }\n\n    if (submittedQuestions.containsKey(\"secQuestion1\") && !submittedQuestions.get(\"secQuestion1\").equals(secQuestionStore.get(verifyUserId).get(\"secQuestion1\"))) {\n        return false;\n    }\n\n    // else\n    return true;\n\n}\n\n",[232,1779,1777],{"__ignoreMap":256},[12,1781,1782,477],{},[227,1783,263],{},[12,1785,1786],{},[227,1787,269],{},[117,1789,1790],{},[37,1791,486],{},[12,1793,1794],{},[227,1795,279],{},[12,1797,1798],{},"This lesson is a hypothetical case where it 'fails open.' In other words by not submitting the validated parameters, the checks are never executed and the verifyAccount method returns true.",[12,1800,1801],{},"SAST tools can not determine 'reasoning' of a methods purpose. This method is not wired into any obvious framework or method that would hint for the SAST tool to know it's for authentication purposes.",[12,1803,1804],{},[227,1805,287],{},[26,1807,1809],{"id":1808},"much-like-above-this-is-a-hypothetical-case-there-is-no-context-around-the-lesson-that-could-assist-a-dast-tool-in-knowing-its-testing-a-password-reset-function","Much like above, this is a hypothetical case. There is no context around the lesson that could assist a DAST tool in knowing it's testing a password reset function.",[50,1811,1813],{"id":1812},"a2-broken-authentication-jwt-tokens-jwt-signing","(A2) Broken Authentication > JWT tokens > JWT signing",[12,1815,1816,230,1818],{},[227,1817,229],{},[232,1819,1820],{},"http://localhost:8080/WebGoat/start.mvc#lesson/JWT.lesson/3",[12,1822,1823,1825],{},[227,1824,239],{}," - webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTVotesEndpoint.java",[12,1827,1828,1830,1831,1834,1835,1838],{},[227,1829,245],{},"\nThis lesson is for modifying JWT claims to impersonate or elevate privileges. It is a multi-step process. First to get a JWT value you need to use the fake 'login' ",[232,1832,1833],{},"/JWT/votings/login?user="," endpoint, which sets it in an HTTP cookie. Next, the goal is to bypass authorization checks and reset the votes by issuing a POST request to the ",[232,1836,1837],{},"/JWT/votings"," with a modified token. The modifications require setting the alg to None and changing the admin parameter to true.",[250,1840,1843],{"className":1841,"code":1842,"language":255,"meta":256},[253],"webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTVotesEndpoint.java#L163-165\n\nJwt jwt = Jwts.parser().setSigningKey(JWT_PASSWORD).parse(accessToken);\nClaims claims = (Claims) jwt.getBody();\nboolean isAdmin = Boolean.valueOf((String) claims.get(\"admin\"));\n",[232,1844,1842],{"__ignoreMap":256},[12,1846,1847,1849],{},[227,1848,263],{}," - Probable",[12,1851,1852],{},[227,1853,269],{},[117,1855,1856],{},[37,1857,486],{},[12,1859,1860],{},[227,1861,279],{},[12,1863,1864,1865,1868,1869,1872,1873,1876,1877],{},"A SAST tool would need to be used in conjunction with a dependency scanning solution that looked for vulnerable libraries. This vulnerability exists due to the dependency on ",[232,1866,1867],{},"io.jsonwebtoken"," version 0.7.0. Using static analysis alone would be difficult for a SAST tool to identify that the ",[232,1870,1871],{},"setSigningKey"," would be ignored if the algorithm was set to ",[232,1874,1875],{},"None",". Additionally, authorization issues are usually difficult for SAST to identify in terms of simple conditional statements.\n",[227,1878,287],{},[12,1880,1881,1882,1884],{},"Vulnerabilities that require multiple steps are usually difficult for DAST tools to identify. If the JWT was used in an authentication endpoint, it may be possible for a DAST tool to identify a vulnerability. It would attempt to modify the JWT and determine if it was able to successfully login. A DAST tool would be unable to determine that the secondary ",[232,1883,1837],{}," endpoint suffers from verification flaw.",[210,1886],{},[50,1888,1890],{"id":1889},"a2-broken-authentication-jwt-tokens-jwt-cracking","(A2) Broken Authentication > JWT tokens > JWT cracking",[12,1892,1893,230,1895],{},[227,1894,229],{},[232,1896,1897],{},"http://localhost:8080/WebGoat/start.mvc#lesson/JWT.lesson/4",[12,1899,1900,1902],{},[227,1901,239],{}," - webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTSecretKeyEndpoint.java",[12,1904,1905,1907,1908,1911],{},[227,1906,245],{},"\nThis lesson is for cracking a JWT value which uses an insecure cryptographic algorithm. ",[232,1909,1910],{},"HS256"," JWT values include a signature which can generated and compared by brute forcing tools.",[250,1913,1916],{"className":1914,"code":1915,"language":255,"meta":256},[253],"webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTSecretKeyEndpoint.java#L57-68\n\npublic String getSecretToken() {\n    return Jwts.builder()\n            .setIssuer(\"WebGoat Token Builder\")\n            .setAudience(\"webgoat.org\")\n            .setIssuedAt(Calendar.getInstance().getTime())\n            .setExpiration(Date.from(Instant.now().plusSeconds(60)))\n            .setSubject(\"tom@webgoat.org\")\n            .claim(\"username\", \"Tom\")\n            .claim(\"Email\", \"tom@webgoat.org\")\n            .claim(\"Role\", new String[]{\"Manager\", \"Project Administrator\"})\n            .signWith(SignatureAlgorithm.HS256, JWT_SECRET).compact();\n    }\n\n",[232,1917,1915],{"__ignoreMap":256},[12,1919,1920,264],{},[227,1921,263],{},[12,1923,1924],{},[227,1925,269],{},[117,1927,1928],{},[37,1929,274],{},[12,1931,1932],{},[227,1933,279],{},[12,1935,1936,1937,1940,1941,1944],{},"A SAST tool that included this particular ",[232,1938,1939],{},"Jwts"," library signatures would be able to identify that the ",[232,1942,1943],{},"signWith"," method is a potential sink and the first parameter determines if a vulnerability exists, depending on the argument's value.",[12,1946,1947],{},[227,1948,287],{},[12,1950,1951],{},"A DAST tool with builtin JWT cracking functionality would be able to extract JWT values encountered during crawling and attempt to brute force the signature. Note the ability to actually determine vulnerability would be dependent on the weakness of the JWT key used for signing.",[210,1953],{},[50,1955,1957],{"id":1956},"a2-broken-authentication-jwt-tokens-refreshing-a-token-incomplete-lesson","(A2) Broken Authentication > JWT tokens > Refreshing a token (incomplete lesson)",[12,1959,1960,230,1962],{},[227,1961,229],{},[232,1963,1964],{},"http://localhost:8080/WebGoat/start.mvc#lesson/JWT.lesson/6",[12,1966,1967,1969],{},[227,1968,239],{}," - webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTRefreshEndpoint.java",[12,1971,1972],{},[227,1973,245],{},[12,1975,1976],{},"This lesson as of v8.1.0 is still incomplete, as the lesson page details do not give enough information to solve. Only by looking at the source and getting the username/password can one solve this challenge. The underlying flaw is that the application does not properly associate refresh tokens with access tokens, allowing one who has captured a leaked refresh token to update someone else's access token.",[250,1978,1981],{"className":1979,"code":1980,"language":255,"meta":256},[253],"webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTRefreshEndpoint.java#L116-122\n\ntry {\n    Jwt\u003CHeader, Claims> jwt = Jwts.parser().setSigningKey(JWT_PASSWORD).parse(token.replace(\"Bearer \", \"\"));\n    user = (String) jwt.getBody().get(\"user\");\n    refreshToken = (String) json.get(\"refresh_token\");\n} catch (ExpiredJwtException e) {\n    user = (String) e.getClaims().get(\"user\");\n    refreshToken = (String) json.get(\"refresh_token\");\n}\n...\n",[232,1982,1980],{"__ignoreMap":256},[12,1984,1985,1987],{},[227,1986,263],{}," - Improbable",[12,1989,1990],{},[227,1991,269],{},[117,1993,1994],{},[37,1995,274],{},[12,1997,1998],{},[227,1999,279],{},[12,2001,2002,2003],{},"A SAST tool would not be able to reason the logic behind requiring the access token and refresh token to be linked unless this logic was built into the JWT library. It could be possible with a very strictly defined set of a rule sets to find this flaw, but it is highly improbable.\n",[227,2004,287],{},[26,2006,2008],{"id":2007},"a-dast-tool-could-be-configured-to-contain-two-user-accounts-and-authorize-to-get-both-tokens-it-could-then-attempt-to-switch-one-users-refresh-token-with-the-secondary-user-and-determine-if-the-server-responded-with-a-new-access-token","A DAST tool could be configured to contain two user accounts and authorize to get both tokens. It could then attempt to switch one user's refresh token with the secondary user and determine if the server responded with a new access token.",[50,2010,2012],{"id":2011},"a2-broken-authentication-jwt-tokens-final-challenges","(A2) Broken Authentication > JWT tokens > Final challenges",[12,2014,2015,230,2017],{},[227,2016,229],{},[232,2018,2019],{},"http://localhost:8080/WebGoat/start.mvc#lesson/JWT.lesson/7",[12,2021,2022,2024],{},[227,2023,239],{}," - webgoat-lessons/jwt/src/main/java/org/owasp/webgoat/jwt/JWTFinalEndpoint.java",[12,2026,2027,2029,2030,2033],{},[227,2028,245],{},"\nThis lesson is a highly improbable series of events that could lead to overwriting a signing key stored in a database. The underlying vulnerability here is actually SQL injection that is exploitable by modifying the ",[232,2031,2032],{},"kid"," JWT field.",[250,2035,2038],{"className":2036,"code":2037,"language":255,"meta":256},[253],"L162-176\nJwt jwt = Jwts.parser().setSigningKeyResolver(new SigningKeyResolverAdapter() {\n    @Override\n    public byte[] resolveSigningKeyBytes(JwsHeader header, Claims claims) {\n        final String kid = (String) header.get(\"kid\");\n        try (var connection = dataSource.getConnection()) {\n            ResultSet rs = connection.createStatement().executeQuery(\"SELECT key FROM jwt_keys WHERE id = '\" + kid + \"'\");\n            while (rs.next()) {\n                return TextCodec.BASE64.decode(rs.getString(1));\n            }\n        } catch (SQLException e) {\n            errorMessage[0] = e.getMessage();\n        }\n        return null;\n    }\n}).parseClaimsJws(token);\n...\n",[232,2039,2037],{"__ignoreMap":256},[12,2041,2042,264],{},[227,2043,263],{},[12,2045,2046],{},[227,2047,269],{},[117,2049,2050],{},[37,2051,274],{},[12,2053,2054],{},[227,2055,279],{},[12,2057,2058,2059,2061],{},"A SAST tool would flag this particular issue as a SQL injection flaw. SAST tools with taint tracking capabilities, or one that has added signatures for sources and sinks of this JWT library, could follow that the token was decoded and the ",[232,2060,2032],{}," came from user input. It would then identify on line 167 user supplied input was used in generation of a dynamically generated SQL query. SAST tools which take a more grep like approach, would most likely flag line 167 as the vulnerability since string concatenation used in a SQL query.",[12,2063,2064],{},[227,2065,287],{},[12,2067,2068],{},"A DAST tool could be configured to decode JWT claims and attempt SQL injection in the various fields.",[12,2070,2071],{},[227,2072,299],{},[117,2074,2075,2078],{},[37,2076,2077],{},"Decode JWT",[37,2079,2080],{},"Modify the JWT header",[250,2082,2085],{"className":2083,"code":2084,"language":255,"meta":256},[253],"{\n  \"typ\": \"JWT\",\n  \"kid\": \"'+(select repeat('a',50000000) from INFORMATION_SCHEMA.tables)+'\",\n  \"alg\": \"HS256\"\n}\n",[232,2086,2084],{"__ignoreMap":256},[117,2088,2089,2092],{},[37,2090,2091],{},"Re-encode the token",[37,2093,2094],{},"Send request during a timing attack verification phase.",[210,2096],{},[50,2098,2100],{"id":2099},"a2-broken-authentication-password-reset-security-questions","(A2) Broken Authentication > Password reset > Security questions",[12,2102,2103,230,2105],{},[227,2104,229],{},[232,2106,2107],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PasswordReset.lesson/3",[12,2109,2110,2112],{},[227,2111,239],{}," - webgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/QuestionsAssignment.java",[12,2114,2115],{},[227,2116,245],{},[12,2118,2119],{},"This lesson is to demonstrate the ability of guessing or brute forcing security questions. The users and security questions are hardcoded. The goal is to guess one of them.",[250,2121,2124],{"className":2122,"code":2123,"language":255,"meta":256},[253],"webgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/QuestionsAssignment.java#L45-51\n\nstatic {\n    COLORS.put(\"admin\", \"green\");\n    COLORS.put(\"jerry\", \"orange\");\n    ...\n}\n\nwebgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/QuestionsAssignment.java#L63-68\n\nString validAnswer = COLORS.get(username.toLowerCase());\nif (validAnswer == null) {\n    return failed(this).feedback(\"password-questions-unknown-user\").feedbackArgs(username).build();\n} else if (validAnswer.equals(securityQuestion)) {\n    return success(this).build();\n}\n",[232,2125,2123],{"__ignoreMap":256},[12,2127,2128],{},[227,2129,263],{},[117,2131,2132],{},[37,2133,486],{},[12,2135,2136],{},[227,2137,269],{},[117,2139,2140],{},[37,2141,1407],{},[12,2143,2144],{},[227,2145,279],{},[12,2147,2148],{},"A SAST tool would be unable to determine that this lesson has any relation to login logic as it's doing a simple existence check of inputs against a map value.",[12,2150,2151],{},[227,2152,287],{},[12,2154,2155],{},"A DAST tool would need to be configured to treat this form as a login form for it to detect any potential discrepancy between a valid and invalid security question answer.",[210,2157],{},[50,2159,2161],{"id":2160},"a2-broken-authentication-password-reset-creating-the-password-reset-link","(A2) Broken Authentication > Password reset > Creating the password reset link",[12,2163,2164,230,2166],{},[227,2165,229],{},[232,2167,2168],{},"http://localhost:8080/WebGoat/start.mvc#lesson/PasswordReset.lesson/5",[12,2170,2171,2173],{},[227,2172,239],{}," - webgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/ResetLinkAssignmentForgotPassword.java",[117,2175,2176],{},[37,2177,2178],{},"webgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/ResetLinkAssignment.java",[12,2180,2181],{},[227,2182,245],{},[12,2184,2185],{},"This lesson is to demonstrate incorrect usage of user supplied data (taken from the host header) in constructing a link. The goal is to abuse this to get a hypothetical user to click on a password reset link that points to the wrong host.",[250,2187,2190],{"className":2188,"code":2189,"language":255,"meta":256},[253],"webgoat-lessons/password-reset/src/main/java/org/owasp/webgoat/password_reset/ResetLinkAssignmentForgotPassword.java#L60-74\n\nString resetLink = UUID.randomUUID().toString();\nResetLinkAssignment.resetLinks.add(resetLink);\nString host = request.getHeader(\"host\");\nif (hasText(email)) {\n    if (email.equals(ResetLinkAssignment.TOM_EMAIL) && (host.contains(\"9090\")||host.contains(\"webwolf\"))) { //User indeed changed the host header.\n        ResetLinkAssignment.userToTomResetLink.put(getWebSession().getUserName(), resetLink);\n        fakeClickingLinkEmail(host, resetLink);\n    } else {\n        try {\n            sendMailToUser(email, host, resetLink);\n        } catch (Exception e) {\n            return failed(this).output(\"E-mail can't be send. please try again.\").build();\n        }\n    }\n}\n",[232,2191,2189],{"__ignoreMap":256},[12,2193,2194,1987],{},[227,2195,263],{},[12,2197,2198],{},[227,2199,269],{},[117,2201,2202],{},[37,2203,486],{},[12,2205,2206],{},[227,2207,279],{},[12,2209,2210],{},"This is a hypothetical issue that most likely would not occur in the wild. There is no real way of a SAST tool to know that the extracted host header was incorrectly used in constructing a link.",[12,2212,2213],{},[227,2214,287],{},[12,2216,2217,2218,2221],{},"A DAST tool would first need to be configured to treat this form as a login or password reset form. It would then also need to know that the conditions for getting a response required the host header to contain port 9090 or the string ",[232,2219,2220],{},"webwolf",". This is a highly improbable set of conditions a DAST tool (or even a human without source) would need to know to have the flaw triggered. Additionally, this flaw requires a form of user interaction (although it's faked on line 66) which a DAST tool would not be able to do.",[210,2223],{},[26,2225,2227],{"id":2226},"a3-sensitive-data-exposure","(A3) > Sensitive Data Exposure",[210,2229],{},[213,2231,2232,2234,2236,2240,2247,2252,2256,2259,2265,2270,2274,2278,2282,2287,2290],{},[216,2233,219],{"markdown":218},[210,2235],{},[50,2237,2239],{"id":2238},"a3-sensitive-data-exposure-insecure-login-lets-try","(A3) > Sensitive Data Exposure > Insecure Login > Let's try",[12,2241,2242,230,2244],{},[227,2243,229],{},[232,2245,2246],{},"http://localhost:8080/WebGoat/start.mvc#lesson/InsecureLogin.lesson/1",[12,2248,2249,2251],{},[227,2250,239],{}," - webgoat-lessons/insecure-login/src/main/java/org/owasp/webgoat/insecure_login/InsecureLoginTask.java",[12,2253,2254],{},[227,2255,245],{},[12,2257,2258],{},"This lesson is to demonstrate sending credentials over plain text communications. It does not contain any real flaws.",[250,2260,2263],{"className":2261,"code":2262,"language":255,"meta":256},[253],"webgoat-lessons/insecure-login/src/main/java/org/owasp/webgoat/insecure_login/InsecureLoginTask.java#L35-37\n\nif (username.toString().equals(\"CaptainJack\") && password.toString().equals(\"BlackPearl\")) {\n    return success(this).build();\n}\n",[232,2264,2262],{"__ignoreMap":256},[12,2266,2267,2269],{},[227,2268,263],{}," - Possible (different issue)",[12,2271,2272],{},[227,2273,269],{},[117,2275,2276],{},[37,2277,593],{},[12,2279,2280],{},[227,2281,279],{},[12,2283,2284,2285],{},"The source is only doing a simple equality test between user input and two constant values. There is a chance, depending on the SAST tool, that it would flag the password equality check as a hardcoded password.\n",[227,2286,287],{},[12,2288,2289],{},"If this page were configured as a login page and it were accessed over HTTP, there is a chance a DAST tool would report this as credentials being sent over a plain text transport.",[210,2291],{},[26,2293,2295],{"id":2294},"a4-xml-external-entities-xxe","(A4) XML External Entities (XXE)",[210,2297],{},[213,2299,2300,2302,2306,2313,2318,2323,2326,2330,2341,2347,2351,2355,2359,2363,2369,2373,2376,2380,2387,2389,2393,2400,2405,2409,2413,2427,2433,2437,2441,2445,2449,2464,2468,2474,2476,2480,2487,2492,2496,2500,2506,2512,2516,2520,2524,2528,2533,2537,2541],{},[216,2301,219],{"markdown":218},[50,2303,2305],{"id":2304},"a4-xml-external-entities-xxe-xxe-lets-try","(A4) XML External Entities (XXE) > XXE > Let’s try",[12,2307,2308,230,2310],{},[227,2309,229],{},[232,2311,2312],{},"http://localhost:8080/WebGoat/start.mvc#lesson/XXE.lesson/3",[12,2314,2315,2317],{},[227,2316,239],{}," - webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/SimpleXXE.java",[117,2319,2320],{},[37,2321,2322],{},"webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/Comments.java",[12,2324,2325],{},"Class: Injection",[12,2327,2328],{},[227,2329,245],{},[12,2331,2332,2333,2336,2337,2340],{},"This lesson's goal is to exploit an XXE parser to have it return the contents of the OS root path. The target XML parser ",[232,2334,2335],{},"JAXB"," will decode the ",[232,2338,2339],{},"SYSTEM"," entity and return the contents of the specified entity.",[250,2342,2345],{"className":2343,"code":2344,"language":255,"meta":256},[253],"webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/Comments.java#L87-94\n\nprotected Comment parseXml(String xml) throws JAXBException, XMLStreamException {\n    var jc = JAXBContext.newInstance(Comment.class);\n    var xif = XMLInputFactory.newInstance();\n    var xsr = xif.createXMLStreamReader(new StringReader(xml));\n\n    var unmarshaller = jc.createUnmarshaller();\n    return (Comment) unmarshaller.unmarshal(xsr);\n}\n",[232,2346,2344],{"__ignoreMap":256},[12,2348,2349,264],{},[227,2350,263],{},[12,2352,2353],{},[227,2354,269],{},[117,2356,2357],{},[37,2358,593],{},[12,2360,2361],{},[227,2362,279],{},[12,2364,2365,2366,2368],{},"SAST tools should have signatures for common XML parsers like ",[232,2367,2335],{}," and determine if they do or do not disable entity and DTD resolution prior to processing user input.",[12,2370,2371],{},[227,2372,287],{},[12,2374,2375],{},"Most DAST tools should be able to find this issue even though the attack request's response does not immediately contain the result. A DAST tool should be configured to handle callback related attacks and attempt to force the XML parser to use a URL instead of reading a system file. If the parser is vulnerable, and no egress filtering is in place, the parser will end up initiating a request to the specified URL.",[12,2377,2378],{},[227,2379,299],{},[117,2381,2382],{},[37,2383,2384],{},[232,2385,2386],{},"\u003C?xml version=\"1.0\"?>\u003C!DOCTYPE text [\u003C!ENTITY xxe SYSTEM \"http://callbackserver:9090/test\">]>\u003Ccomment>\u003Ctext>&xxe;\u003C/text>\u003C/comment>",[210,2388],{},[50,2390,2392],{"id":2391},"a4-xml-external-entities-xxe-xxe-modern-rest-framework","(A4) XML External Entities (XXE) > XXE > Modern REST framework",[12,2394,2395,230,2397],{},[227,2396,229],{},[232,2398,2399],{},"http://localhost:8080/WebGoat/start.mvc#lesson/XXE.lesson/6",[12,2401,2402,2404],{},[227,2403,239],{}," - webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/ContentTypeAssignment.java",[117,2406,2407],{},[37,2408,2322],{},[12,2410,2411],{},[227,2412,245],{},[12,2414,2415,2416,2418,2419,2422,2423,2426],{},"This lesson's goal is to exploit an XXE parser to have it return the contents of the OS root path, much like ",[232,2417,2312],{},". The only difference is the ",[232,2420,2421],{},"/WebGoat/xxe/content-type"," endpoint accepts both JSON and XML. This is more of a hypothetical situation due to unrealistic conditional statements used to only allow valid responses if they are met. The same underlying ",[232,2424,2425],{},"parseXml"," is called for both of these lessons.",[250,2428,2431],{"className":2429,"code":2430,"language":255,"meta":256},[253],"webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/ContentTypeAssignment.java#L56-64\n\nif (APPLICATION_JSON_VALUE.equals(contentType)) {\n            comments.parseJson(commentStr).ifPresent(c -> comments.addComment(c, true));\n            attackResult = failed(this).feedback(\"xxe.content.type.feedback.json\").build();\n        }\n\n        if (null != contentType && contentType.contains(MediaType.APPLICATION_XML_VALUE)) {\n            String error = \"\";\n            try {\n                Comment comment = comments.parseXml(commentStr);\n...\n\nwebgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/Comments.java#L87-94\n\nprotected Comment parseXml(String xml) throws JAXBException, XMLStreamException {\n    var jc = JAXBContext.newInstance(Comment.class);\n    var xif = XMLInputFactory.newInstance();\n    var xsr = xif.createXMLStreamReader(new StringReader(xml));\n\n    var unmarshaller = jc.createUnmarshaller();\n    return (Comment) unmarshaller.unmarshal(xsr);\n}\n",[232,2432,2430],{"__ignoreMap":256},[12,2434,2435,264],{},[227,2436,263],{},[12,2438,2439],{},[227,2440,269],{},[117,2442,2443],{},[37,2444,1407],{},[12,2446,2447],{},[227,2448,279],{},[12,2450,2451,2452,2455,2456,2459,2460,2463],{},"A SAST tool will most likely disregard the conditional checks necessary to call the ",[232,2453,2454],{},"comments.parseXml"," on line 64 of ",[232,2457,2458],{},"ContentTypeAssignment",". It should determine that the input string is parsed by an XML parser in ",[232,2461,2462],{},"Comments.java"," that did not disable entity or DTD resolution.",[12,2465,2466],{},[227,2467,287],{},[12,2469,2470,2471,2473],{},"Most DAST tools will attempt to inject into parameter names and values, not transform the entire method from one to the other. The conditional checks in ",[232,2472,2458],{}," lines 56 and 61 are not realistic and would most likely block legitimate attack cases.",[210,2475],{},[50,2477,2479],{"id":2478},"a4-xml-external-entities-xxe-xxe-blind-xxe-assignment","(A4) XML External Entities (XXE) > XXE > Blind XXE assignment",[12,2481,2482,230,2484],{},[227,2483,229],{},[232,2485,2486],{},"http://localhost:8080/WebGoat/start.mvc#lesson/XXE.lesson/10",[12,2488,2489,2491],{},[227,2490,239],{}," - webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/BlindSendFileAssignment.java",[117,2493,2494],{},[37,2495,2322],{},[12,2497,2498],{},[227,2499,245],{},[12,2501,2502,2503,2505],{},"This lesson's goal is to exploit an XXE parser to have it post the contents of a file to a callback server. The same underlying ",[232,2504,2425],{}," is called for this lesson as well.",[250,2507,2510],{"className":2508,"code":2509,"language":255,"meta":256},[253],"webgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/BlindSendFileAssignment.java#L56-64\n\n public AttackResult addComment(@RequestBody String commentStr) {\n        //Solution is posted as a separate comment\n        if (commentStr.contains(CONTENTS)) {\n            return success(this).build();\n        }\n\n        try {\n            Comment comment = comments.parseXml(commentStr);\n            comments.addComment(comment, false);\n        } catch (Exception e) {\n            return failed(this).output(e.toString()).build();\n        }\n        return failed(this).build();\n    }\n...\n\nwebgoat-lessons/xxe/src/main/java/org/owasp/webgoat/xxe/Comments.java#L87-94\n\nprotected Comment parseXml(String xml) throws JAXBException, XMLStreamException {\n    var jc = JAXBContext.newInstance(Comment.class);\n    var xif = XMLInputFactory.newInstance();\n    var xsr = xif.createXMLStreamReader(new StringReader(xml));\n\n    var unmarshaller = jc.createUnmarshaller();\n    return (Comment) unmarshaller.unmarshal(xsr);\n}\n",[232,2511,2509],{"__ignoreMap":256},[12,2513,2514,264],{},[227,2515,263],{},[12,2517,2518],{},[227,2519,269],{},[117,2521,2522],{},[37,2523,593],{},[12,2525,2526],{},[227,2527,279],{},[12,2529,2530,2531],{},"This flaw is the same as ",[232,2532,2305],{},[12,2534,2535],{},[227,2536,287],{},[12,2538,2530,2539],{},[232,2540,2305],{},[210,2542],{},[26,2544,2546],{"id":2545},"a5-broken-access-control","(A5) Broken Access Control",[210,2548],{},[213,2550,2551,2553,2557,2564,2569,2573,2576,2582,2586,2590,2594,2598,2601,2605,2607,2609,2613,2620,2625,2629,2632,2638,2642,2646,2650,2654,2657,2661,2663,2665,2669,2676,2681,2685,2691,2697,2701,2705,2709,2713,2715,2719,2729,2731,2735,2742,2747,2752,2756,2761,2767,2771,2775,2779,2783,2786,2790],{},[216,2552,219],{"markdown":218},[50,2554,2556],{"id":2555},"a5-broken-access-control-insecure-direct-object-references-authenticate-first-abuse-authorization-later","(A5) Broken Access Control > Insecure Direct Object References > Authenticate First, Abuse Authorization Later",[12,2558,2559,230,2561],{},[227,2560,229],{},[232,2562,2563],{},"http://localhost:8080/WebGoat/start.mvc#lesson/IDOR.lesson/1",[12,2565,2566,2568],{},[227,2567,239],{}," - webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORLogin.java",[12,2570,2571],{},[227,2572,245],{},[12,2574,2575],{},"This lesson is for assigning the current session to a user profile for subsequent lessons – it is not supposed to contain any vulnerabilities.",[250,2577,2580],{"className":2578,"code":2579,"language":255,"meta":256},[253],"webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORLogin.java#L59-74\n\npublic AttackResult completed(@RequestParam String username, @RequestParam String password) {\n        initIDORInfo();\n        UserSessionData userSessionData = getUserSessionData();\n\n        if (idorUserInfo.containsKey(username)) {\n            if (\"tom\".equals(username) && idorUserInfo.get(\"tom\").get(\"password\").equals(password)) {\n                userSessionData.setValue(\"idor-authenticated-as\", username);\n                userSessionData.setValue(\"idor-authenticated-user-id\", idorUserInfo.get(username).get(\"id\"));\n                return success(this).feedback(\"idor.login.success\").feedbackArgs(username).build();\n            } else {\n                return failed(this).feedback(\"idor.login.failure\").build();\n            }\n        } else {\n            return failed(this).feedback(\"idor.login.failure\").build();\n        }\n    }\n",[232,2581,2579],{"__ignoreMap":256},[12,2583,2584,477],{},[227,2585,263],{},[12,2587,2588],{},[227,2589,269],{},[117,2591,2592],{},[37,2593,486],{},[12,2595,2596],{},[227,2597,279],{},[12,2599,2600],{},"There is nothing to find as it's only adding server side session data.",[12,2602,2603],{},[227,2604,287],{},[12,2606,2600],{},[210,2608],{},[50,2610,2612],{"id":2611},"a5-broken-access-control-insecure-direct-object-references-observing-differences-behaviors","(A5) Broken Access Control > Insecure Direct Object References > Observing Differences & Behaviors",[12,2614,2615,230,2617],{},[227,2616,229],{},[232,2618,2619],{},"http://localhost:8080/WebGoat/start.mvc#lesson/IDOR.lesson/2",[12,2621,2622,2624],{},[227,2623,239],{}," - webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORDiffAttributes.java",[12,2626,2627],{},[227,2628,245],{},[12,2630,2631],{},"This lesson demonstrates hidden authorization properties and does not contain any real flaws.",[250,2633,2636],{"className":2634,"code":2635,"language":255,"meta":256},[253],"webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORDiffAttributes.java#L36-48\n\npublic AttackResult completed(@RequestParam String attributes) {\n    attributes = attributes.trim();\n    String[] diffAttribs = attributes.split(\",\");\n    if (diffAttribs.length \u003C 2) {\n        return failed(this).feedback(\"idor.diff.attributes.missing\").build();\n    }\n    if (diffAttribs[0].toLowerCase().trim().equals(\"userid\") && diffAttribs[1].toLowerCase().trim().equals(\"role\")\n            || diffAttribs[1].toLowerCase().trim().equals(\"userid\") && diffAttribs[0].toLowerCase().trim().equals(\"role\")) {\n        return success(this).feedback(\"idor.diff.success\").build();\n    } else {\n        return failed(this).feedback(\"idor.diff.failure\").build();\n    }\n}\n",[232,2637,2635],{"__ignoreMap":256},[12,2639,2640,477],{},[227,2641,263],{},[12,2643,2644],{},[227,2645,269],{},[117,2647,2648],{},[37,2649,486],{},[12,2651,2652],{},[227,2653,279],{},[12,2655,2656],{},"There is nothing to find, as it's only doing a comparison between inputs and expected values.",[12,2658,2659],{},[227,2660,287],{},[12,2662,2656],{},[210,2664],{},[50,2666,2668],{"id":2667},"a5-broken-access-control-insecure-direct-object-references-guessing-predicting-patterns","(A5) Broken Access Control > Insecure Direct Object References > Guessing & Predicting Patterns",[12,2670,2671,230,2673],{},[227,2672,229],{},[232,2674,2675],{},"http://localhost:8080/WebGoat/start.mvc#lesson/IDOR.lesson/3",[12,2677,2678,2680],{},[227,2679,239],{}," - webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORViewOwnProfileAltUrl.java",[12,2682,2683],{},[227,2684,245],{},[12,2686,2687,2688,133],{},"This lesson demonstrates accessing your own profile by using a direct object reference (userid). This lesson requires that you are already logged in via the hypothetical login endpoint ",[232,2689,2690],{},"/WebGoat/IDOR/login",[250,2692,2695],{"className":2693,"code":2694,"language":255,"meta":256},[253],"webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORViewOwnProfileAltUrl.java#L42-62\n\npublic AttackResult completed(@RequestParam String url) {\n        try {\n            if (userSessionData.getValue(\"idor-authenticated-as\").equals(\"tom\")) {\n                //going to use session auth to view this one\n                String authUserId = (String) userSessionData.getValue(\"idor-authenticated-user-id\");\n                //don't care about `http://localhost:8080` ... just want WebGoat/\n                String[] urlParts = url.split(\"/\");\n                if (urlParts[0].equals(\"WebGoat\") && urlParts[1].equals(\"IDOR\") && urlParts[2].equals(\"profile\") && urlParts[3].equals(authUserId)) {\n                    UserProfile userProfile = new UserProfile(authUserId);\n                    return success(this).feedback(\"idor.view.own.profile.success\").output(userProfile.profileToMap().toString()).build();\n                } else {\n                    return failed(this).feedback(\"idor.view.own.profile.failure1\").build();\n                }\n\n            } else {\n                return failed(this).feedback(\"idor.view.own.profile.failure2\").build();\n            }\n        } catch (Exception ex) {\n            return failed(this).feedback(\"an error occurred with your request\").build();\n        }\n    }\n",[232,2696,2694],{"__ignoreMap":256},[12,2698,2699,477],{},[227,2700,263],{},[12,2702,2703],{},[227,2704,269],{},[117,2706,2707],{},[37,2708,486],{},[12,2710,2711],{},[227,2712,279],{},[12,2714,2656],{},[12,2716,2717],{},[227,2718,287],{},[12,2720,2721,2722,2724,2725,2728],{},"There is nothing to find, as it's only doing a comparison between inputs and expected values. Additionally, the DAST tool would need to be configured to treat the ",[232,2723,2690],{}," page as a login form to be able to successfully set the additional server side session data. However, a DAST tool must already be configured to login to the ",[232,2726,2727],{},"/WebGoat/"," end point and most DAST tools don't support logging in multiple times to different endpoints for the same scan.",[210,2730],{},[50,2732,2734],{"id":2733},"a5-broken-access-control-insecure-direct-object-references-playing-with-the-patterns","(A5) Broken Access Control > Insecure Direct Object References > Playing with the Patterns",[12,2736,2737,230,2739],{},[227,2738,229],{},[232,2740,2741],{},"http://localhost:8080/WebGoat/start.mvc#lesson/IDOR.lesson/4",[12,2743,2744,2746],{},[227,2745,239],{}," - webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORViewOtherProfile.java",[117,2748,2749],{},[37,2750,2751],{},"webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDOREditOtherProfiile.java",[12,2753,2754],{},[227,2755,245],{},[12,2757,2758,2759,133],{},"This lesson demonstrates accessing a mock users profile by using a direct object reference (userid). This lesson requires that you are already logged in via the hypothetical login endpoint ",[232,2760,2690],{},[250,2762,2765],{"className":2763,"code":2764,"language":255,"meta":256},[253],"webgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDORViewOtherProfile.java#L48-67\n\npublic AttackResult completed(@PathVariable(\"userId\") String userId, HttpServletResponse resp) {\n        Map\u003CString, Object> details = new HashMap\u003C>();\n\n        if (userSessionData.getValue(\"idor-authenticated-as\").equals(\"tom\")) {\n            //going to use session auth to view this one\n            String authUserId = (String) userSessionData.getValue(\"idor-authenticated-user-id\");\n            if (userId != null && !userId.equals(authUserId)) {\n                //on the right track\n                UserProfile requestedProfile = new UserProfile(userId);\n                // secure code would ensure there was a horizontal access control check prior to dishing up the requested profile\n                if (requestedProfile.getUserId().equals(\"2342388\")) {\n                    return success(this).feedback(\"idor.view.profile.success\").output(requestedProfile.profileToMap().toString()).build();\n                } else {\n                    return failed(this).feedback(\"idor.view.profile.close1\").build();\n                }\n            } else {\n                return failed(this).feedback(\"idor.view.profile.close2\").build();\n            }\n        }\n        return failed(this).build();\n\nwebgoat-lessons/idor/src/main/java/org/owasp/webgoat/idor/IDOREditOtherProfiile.java#L41-88\npublic AttackResult completed(@PathVariable(\"userId\") String userId, @RequestBody UserProfile userSubmittedProfile) {\n\n    String authUserId = (String) userSessionData.getValue(\"idor-authenticated-user-id\");\n    // this is where it starts ... accepting the user submitted ID and assuming it will be the same as the logged in userId and not checking for proper authorization\n    // Certain roles can sometimes edit others' profiles, but we shouldn't just assume that and let everyone, right?\n    // Except that this is a vulnerable app ... so we will\n    UserProfile currentUserProfile = new UserProfile(userId);\n    if (userSubmittedProfile.getUserId() != null && !userSubmittedProfile.getUserId().equals(authUserId)) {\n        // let's get this started ...\n        currentUserProfile.setColor(userSubmittedProfile.getColor());\n        currentUserProfile.setRole(userSubmittedProfile.getRole());\n        // we will persist in the session object for now in case we want to refer back or use it later\n        userSessionData.setValue(\"idor-updated-other-profile\", currentUserProfile);\n        if (currentUserProfile.getRole() \u003C= 1 && currentUserProfile.getColor().toLowerCase().equals(\"red\")) {\n            return success(this)\n                    .feedback(\"idor.edit.profile.success1\")\n                    .output(currentUserProfile.profileToMap().toString())\n                    .build();\n        }\n...\n",[232,2766,2764],{"__ignoreMap":256},[12,2768,2769,477],{},[227,2770,263],{},[12,2772,2773],{},[227,2774,269],{},[117,2776,2777],{},[37,2778,1407],{},[12,2780,2781],{},[227,2782,279],{},[12,2784,2785],{},"SAST tools have difficulties determining authorization checks unless custom rule sets are configured.",[12,2787,2788],{},[227,2789,287],{},[26,2791,2793,2794,2796,2797,2800,2801,2804],{"id":2792},"idor-based-attacks-can-be-difficult-for-dast-tools-to-detect-the-dast-tool-would-need-to-be-configured-to-treat-the-webgoatidorlogin-page-as-a-login-form-to-be-able-to-successfully-set-the-additional-server-side-session-data-after-which-it-would-somehow-need-to-determine-that-the-edit-and-view-profile-endpoint-at-webgoatidorprofileuser-should-have-the-user-field-replaced-with-the-userid-of-the-same-user-and-then-replaced-as-a-different-user-to-trigger-the-flaw","IDOR-based attacks can be difficult for DAST tools to detect. The DAST tool would need to be configured to treat the ",[232,2795,2690],{}," page as a login form to be able to successfully set the additional server side session data. After which it would somehow need to determine that the edit and view profile endpoint at ",[232,2798,2799],{},"/WebGoat/IDOR/profile/{user}"," should have the ",[232,2802,2803],{},"{user}"," field replaced with the userid of the same user, and then replaced as a different user to trigger the flaw.",[26,2806,2808],{"id":2807},"a7-cross-site-scripting-xss","(A7) Cross-Site Scripting (XSS)",[210,2810],{},[213,2812,2813,2815,2819,2826,2831,2838,2845,2851,2855,2859,2863,2867,2884,2888,2891,2895,2902,2904,2908,2915,2920,2924,2931,2937,2941,2945,2949,2953,2955,2959,2961,2963,2967,2974,2979,2987,2991,3002,3008,3012,3016,3020,3024,3034,3038,3049,3052,3056,3066],{},[216,2814,219],{"markdown":218},[50,2816,2818],{"id":2817},"a7-cross-site-scripting-xss-cross-site-scripting-try-it-reflected-xss","(A7) Cross-Site Scripting (XSS) > Cross Site Scripting > Try It! Reflected XSS",[12,2820,2821,230,2823],{},[227,2822,229],{},[232,2824,2825],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CrossSiteScripting.lesson/6",[12,2827,2828,2830],{},[227,2829,239],{}," - webgoat-lessons/cross-site-scripting/src/main/java/org/owasp/webgoat/xss/CrossSiteScriptingLesson5a.java",[117,2832,2833],{},[37,2834,2835,2836],{},"webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js\n",[227,2837,245],{},[12,2839,2840,2841,2844],{},"This lesson demonstrates a self-reflected XSS vulnerability. The goal is to inject XSS into the ",[232,2842,2843],{},"field1"," parameter.",[250,2846,2849],{"className":2847,"code":2848,"language":255,"meta":256},[253],"webgoat-lessons/cross-site-scripting/src/main/java/org/owasp/webgoat/xss/CrossSiteScriptingLesson5a.java#L56-79\n\ncart.append(\"Thank you for shopping at WebGoat. \u003Cbr />You're support is appreciated\u003Chr />\");\ncart.append(\"\u003Cp>We have charged credit card:\" + field1 + \"\u003Cbr />\");\ncart.append(\"                             ------------------- \u003Cbr />\");\ncart.append(\"                               $\" + totalSale);\n\n//init state\nif (userSessionData.getValue(\"xss-reflected1-complete\") == null) {\n    userSessionData.setValue(\"xss-reflected1-complete\", (Object) \"false\");\n}\n\nif (field1.toLowerCase().matches(\"\u003Cscript>.*(console\\\\.log\\\\(.*\\\\)|alert\\\\(.*\\\\))\u003C\\\\/script>\")) {\n    //return )\n    userSessionData.setValue(\"xss-reflected-5a-complete\", \"true\");\n    if (field1.toLowerCase().contains(\"console.log\")) {\n        return success(this).feedback(\"xss-reflected-5a-success-console\").output(cart.toString()).build();\n    } else {\n        return success(this).feedback(\"xss-reflected-5a-success-alert\").output(cart.toString()).build();\n    }\n} else {\n    userSessionData.setValue(\"xss-reflected1-complete\", \"false\");\n    return success(this)\n            .feedback(\"xss-reflected-5a-failure\")\n            .output(cart.toString())\n            .build();\n}\n...\n\nwebgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js#L183-185\n\nrenderOutput: function (output) {\n    var s = this.removeSlashesFromJSON(output);\n    this.$curOutput.html(polyglot.t(s) || \"\");\n    ...\n",[232,2850,2848],{"__ignoreMap":256},[12,2852,2853,1849],{},[227,2854,263],{},[12,2856,2857],{},[227,2858,269],{},[117,2860,2861],{},[37,2862,593],{},[12,2864,2865],{},[227,2866,279],{},[12,2868,600,2869,2871,2872,2875,2876,2879,2880,2883],{},[232,2870,2843],{}," parameter comes directly from user input and is output in the response on lines 70, 72 and 78. The user input is inserted into the cart ",[232,2873,2874],{},"StringBuffer"," on line 57. However the response for this endpoint is JSON and the reason this is exploitable is due to how the frontend renders the ",[232,2877,2878],{},"output"," JSON field in ",[232,2881,2882],{},"LessonContentView.js",". A SAST tool would need to be able to scan JavaScript and possibly Java to detect this as a Cross-Site Scripting flaw.",[12,2885,2886],{},[227,2887,287],{},[12,2889,2890],{},"This is a straightforward XSS attack. A DAST tool would most likely attempt various XSS attack strings in each parameter value.",[12,2892,2893],{},[227,2894,299],{},[117,2896,2897],{},[37,2898,2899],{},[232,2900,2901],{},"/WebGoat/CrossSiteScripting/attack5a?QTY1=1&QTY2=1&QTY3=1&QTY4=1&field2=12345&field1=%3cimg%20src%3dx+onerror%3dalert(1)%3e",[210,2903],{},[50,2905,2907],{"id":2906},"a7-cross-site-scripting-xss-cross-site-scripting-identify-potential-for-dom-based-xss","(A7) Cross-Site Scripting (XSS) > Cross Site Scripting > Identify potential for DOM-Based XSS",[12,2909,2910,230,2912],{},[227,2911,229],{},[232,2913,2914],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CrossSiteScripting.lesson/9",[12,2916,2917,2919],{},[227,2918,239],{}," - webgoat-lessons/cross-site-scripting/src/main/java/org/owasp/webgoat/xss/CrossSiteScriptingLesson6a.java",[12,2921,2922],{},[227,2923,245],{},[12,2925,2926,2927,2930],{},"This lesson does not contain any vulnerabilities. The goal is to simply identify that ",[232,2928,2929],{},"start.mvc#test"," is the hidden route.",[250,2932,2935],{"className":2933,"code":2934,"language":255,"meta":256},[253],"webgoat-lessons/cross-site-scripting/src/main/java/org/owasp/webgoat/xss/CrossSiteScriptingLesson6a.java#L42-50\n\npublic AttackResult completed(@RequestParam String DOMTestRoute) {\n\n    if (DOMTestRoute.matches(\"start\\\\.mvc#test(\\\\/|)\")) {\n        //return )\n        return success(this).feedback(\"xss-reflected-6a-success\").build();\n    } else {\n        return failed(this).feedback(\"xss-reflected-6a-failure\").build();\n    }\n}\n",[232,2936,2934],{"__ignoreMap":256},[12,2938,2939,477],{},[227,2940,263],{},[12,2942,2943],{},[227,2944,269],{},[117,2946,2947],{},[37,2948,486],{},[12,2950,2951],{},[227,2952,279],{},[12,2954,2656],{},[12,2956,2957],{},[227,2958,287],{},[12,2960,2656],{},[210,2962],{},[50,2964,2966],{"id":2965},"a7-cross-site-scripting-xss-cross-site-scripting-try-it-dom-based-xss","(A7) Cross-Site Scripting (XSS) > Cross Site Scripting > Try It! DOM-Based XSS",[12,2968,2969,230,2971],{},[227,2970,229],{},[232,2972,2973],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CrossSiteScripting.lesson/10",[12,2975,2976,2978],{},[227,2977,239],{}," - webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js",[117,2980,2981,2984],{},[37,2982,2983],{},"webgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js",[37,2985,2986],{},"webgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js",[12,2988,2989],{},[227,2990,245],{},[12,2992,2993,2994,2997,2998,3001],{},"This lesson is a client side DOM-XSS vulnerability that exists in a different java project ",[232,2995,2996],{},"webgoat-container",". The underlying vulnerability is in an insecure call to the ",[232,2999,3000],{},"jQuery.html"," method.",[250,3003,3006],{"className":3004,"code":3005,"language":255,"meta":256},[253],"webgoat-container/src/main/resources/static/js/goatApp/view/GoatRouter.js#L46-117\n\nvar GoatAppRouter = Backbone.Router.extend({\n\n    routes: {\n        'welcome': 'welcomeRoute',\n        'lesson/:name': 'lessonRoute',\n        'lesson/:name/:pageNum': 'lessonPageRoute',\n        'test/:param': 'testRoute',\n        'reportCard': 'reportCard'\n    },\n...\ntestRoute: function (param) {\n            this.lessonController.testHandler(param);\n            //this.menuController.updateMenu(name);\n        },\n...\n\nwebgoat-container/src/main/resources/static/js/goatApp/controller/LessonController.js#156-159\n\nthis.testHandler = function(param) {\n    console.log('test handler');\n    this.lessonContentView.showTestParam(param);\n};\n...\n\nwebgoat-container/src/main/resources/static/js/goatApp/view/LessonContentView.js#L220-222\n\nshowTestParam: function (param) {\n    this.$el.find('.lesson-content').html('test:' + param);\n},\n...\n",[232,3007,3005],{"__ignoreMap":256},[12,3009,3010,264],{},[227,3011,263],{},[12,3013,3014],{},[227,3015,269],{},[117,3017,3018],{},[37,3019,1407],{},[12,3021,3022],{},[227,3023,279],{},[12,3025,3026,3027,3029,3030,3033],{},"A SAST tool that does intra-procedural taint tracking would need to have signatures for the Backbone javascript framework. It would need to follow taint down to the final vulnerability on line 221 of ",[232,3028,2882],{},". A non-intra-procedural taint tracking SAST tool may simply look for any ",[232,3031,3032],{},"html()"," method calls and flag it as a potential sink for XSS.",[12,3035,3036],{},[227,3037,287],{},[12,3039,3040,3041,3044,3045,3048],{},"A DAST tool would most likely need to have some form of SAST-like capabilities to know that the target application not only uses Backbone, but is able to extract the routes from the ",[232,3042,3043],{},"Backbone.router",". It could then potentially attack all URL Fragment based route links. Since the ",[232,3046,3047],{},"#test/"," route is technically never referenced anywhere, it is unlikely that a DAST tool would be able to find this vulnerable route.",[12,3050,3051],{},"Also, since this is a client-side vulnerability, the DAST tool must be instrumenting a real browser, otherwise it would be nearly impossible to trigger the flaw since it is dynamically rewriting the DOM.",[12,3053,3054],{},[227,3055,299],{},[117,3057,3058],{},[37,3059,3060,3061],{},"``",[16,3062,3065],{"href":3063,"rel":3064},"http://localhost:8080/WebGoat/start.mvc#test/%3Cimg%20src=x%20onerror=alert(1%60)%3E%60",[],"http://localhost:8080/WebGoat/start.mvc#test/%3Cimg%20src=x%20onerror=alert(1`)%3E`",[210,3067],{},[26,3069,3071],{"id":3070},"a8-insecure-deserialization","(A8)  Insecure Deserialization",[210,3073],{},[213,3075,3076,3078,3082,3089,3094,3099,3103,3106,3112,3116,3120,3124,3128,3143,3147],{},[216,3077,219],{"markdown":218},[50,3079,3081],{"id":3080},"a8-insecure-deserialization-insecure-deserialization-lets-try","(A8)  Insecure Deserialization > Insecure Deserialization > Let’s try",[12,3083,3084,230,3086],{},[227,3085,229],{},[232,3087,3088],{},"http://localhost:8080/WebGoat/start.mvc#lesson/InsecureDeserialization.lesson/4",[12,3090,3091,3093],{},[227,3092,239],{}," - webgoat-lessons/insecure-deserialization/src/main/java/org/owasp/webgoat/deserialization/InsecureDeserializationTask.java",[117,3095,3096],{},[37,3097,3098],{},"webgoat-lessons/insecure-deserialization/src/main/java/org/dummy/insecure/framework/VulnerableTaskHolder.java",[12,3100,3101],{},[227,3102,245],{},[12,3104,3105],{},"This lesson demonstrates how object deserialization attacks can be exploited to run arbitrary code. In particular this lesson deals with java deserialization attacks.",[250,3107,3110],{"className":3108,"code":3109,"language":255,"meta":256},[253],"webgoat-lessons/insecure-deserialization/src/main/java/org/owasp/webgoat/deserialization/InsecureDeserializationTask.java#L54-56\n\ntry (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(b64token)))) {\n    before = System.currentTimeMillis();\n    Object o = ois.readObject();\n...\n\nwebgoat-lessons/insecure-deserialization/src/main/java/org/dummy/insecure/framework/VulnerableTaskHolder.java#L38-59\n\nprivate void readObject( ObjectInputStream stream ) throws Exception {\n    //unserialize data so taskName and taskAction are available\n    stream.defaultReadObject();\n\n    //do something with the data\n    log.info(\"restoring task: {}\", taskName);\n    log.info(\"restoring time: {}\", requestedExecutionTime);\n\n    if (requestedExecutionTime!=null &&             (requestedExecutionTime.isBefore(LocalDateTime.now().minusMinutes(10))\n            || requestedExecutionTime.isAfter(LocalDateTime.now()))) {\n        //do nothing is the time is not within 10 minutes after the object has been created\n        log.debug(this.toString());\n        throw new IllegalArgumentException(\"outdated\");\n    }\n\n    //condition is here to prevent you from destroying the goat altogether\n    if ((taskAction.startsWith(\"sleep\")||taskAction.startsWith(\"ping\"))\n            && taskAction.length() \u003C 22) {\n    log.info(\"about to execute: {}\", taskAction);\n    try {\n        Process p = Runtime.getRuntime().exec(taskAction);\n...\n",[232,3111,3109],{"__ignoreMap":256},[12,3113,3114,264],{},[227,3115,263],{},[12,3117,3118],{},[227,3119,269],{},[117,3121,3122],{},[37,3123,486],{},[12,3125,3126],{},[227,3127,279],{},[12,3129,3130,3131,3134,3135,3138,3139,3142],{},"A SAST tool should be able to identify the ",[232,3132,3133],{},"Object o = ois.readObject();"," call on line 56 of ",[232,3136,3137],{},"InsecureDeserializationTask.java"," and flag as a potential Deserialization issue. SAST tools would most likely also flag the ",[232,3140,3141],{},"Runetime.getRuntime().exec(taskAction)"," call on line 59 as a potential for OS command injection.",[12,3144,3145],{},[227,3146,287],{},[26,3148,3150,3151,3154],{"id":3149},"dast-tools-usually-work-off-of-intercepting-requests-and-analyzing-parameter-values-to-determine-what-to-inject-the-webgoatinsecuredeserializationtask-endpoint-is-never-triggered-with-a-valid-object-only-a-reference-to-what-is-expected-exists-in-the-html-output-due-to-this-there-is-no-way-for-a-dast-tool-to-know-that-this-endpoint-expects-a-serialized-java-object-and-hence-would-not-be-able-to-attack-it","DAST tools usually work off of intercepting requests and analyzing parameter values to determine what to inject. The ",[232,3152,3153],{},"/WebGoat/InsecureDeserialization/task"," endpoint is never triggered with a valid object, only a reference to what is expected exists in the HTML output. Due to this, there is no way for a DAST tool to know that this endpoint expects a serialized java object, and hence would not be able to attack it.",[26,3156,3158],{"id":3157},"a9-vulnerable-components","(A9) Vulnerable Components",[210,3160],{},[213,3162,3163,3165,3169,3176,3181,3185,3188,3194,3198,3202,3206,3210,3218,3222,3225,3229,3236,3238,3242,3249,3254,3258,3265,3271,3275,3279,3283,3287,3298,3302,3313,3320],{},[216,3164,219],{"markdown":218},[50,3166,3168],{"id":3167},"a9-vulnerable-components-vulnerable-components-the-exploit-is-not-always-in-your-code","(A9) Vulnerable Components > Vulnerable Components > The exploit is not always in \"your\" code",[12,3170,3171,230,3173],{},[227,3172,229],{},[232,3174,3175],{},"http://localhost:8080/WebGoat/start.mvc#lesson/VulnerableComponents.lesson/4",[12,3177,3178,3180],{},[227,3179,239],{}," - webgoat-lessons/vulnerable-components/src/main/resources/html/VulnerableComponents.html",[12,3182,3183],{},[227,3184,245],{},[12,3186,3187],{},"This lesson demonstrates a vulnerable and non-vulnerable version of jquery-ui. The attack is built in to the source HTML form.",[250,3189,3192],{"className":3190,"code":3191,"language":255,"meta":256},[253],"L45-57\n        \u003Ctd>\u003Cinput id=\"closetext\" value=\"OK\u003Cscript>alert('XSS')\u003C/script>\" type=\"TEXT\" />\u003Cinput\n            name=\"SUBMIT\" value=\"Go!\" type=\"SUBMIT\" onclick=\"webgoat.customjs.vuln_jquery_ui()\" />\u003C/td>\n        \u003Ctd>\u003C/td>\n    \u003C/tr>\n\u003C/table>\n\u003Cscript th:inline=\"javascript\">\n/*\u003C![CDATA[*/\nwebgoat.customjs.vuln_jquery_ui = function()\n{\n    webgoat.customjs.jqueryVuln('#dialog').dialog({ closeText: webgoat.customjs.jquery('#closetext').val() });\n};\n/*]]>*/\n    \u003C/script>\n",[232,3193,3191],{"__ignoreMap":256},[12,3195,3196,264],{},[227,3197,263],{},[12,3199,3200],{},[227,3201,269],{},[117,3203,3204],{},[37,3205,593],{},[12,3207,3208],{},[227,3209,279],{},[12,3211,3212,3213,3217],{},"Most likely the SAST tool would ",[3214,3215,3216],"em",{},"not"," trigger on the exact line, but would be used in combination with a dependency scanning tool to identify the outdated version of jquery-ui.",[12,3219,3220],{},[227,3221,287],{},[12,3223,3224],{},"A DAST tool would most likely click the form submission and inject it's own XSS value to trigger the flaw.",[12,3226,3227],{},[227,3228,299],{},[117,3230,3231],{},[37,3232,3233],{},[232,3234,3235],{},"OK\u003Cscript>alert('XSS')\u003C/script>",[210,3237],{},[50,3239,3241],{"id":3240},"a9-vulnerable-components-vulnerable-components-exploiting-cve-2013-7285-xstream","(A9) Vulnerable Components > Vulnerable Components > Exploiting CVE-2013-7285 (XStream)",[12,3243,3244,230,3246],{},[227,3245,229],{},[232,3247,3248],{},"http://localhost:8080/WebGoat/start.mvc#lesson/VulnerableComponents.lesson/11",[12,3250,3251,3253],{},[227,3252,239],{}," - webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/vulnerable_components/VulnerableComponentsLesson.java",[12,3255,3256],{},[227,3257,245],{},[12,3259,3260,3261,3264],{},"This lesson demonstrates a vulnerable version of ",[232,3262,3263],{},"Xstream"," that allows for XXE attacks.",[250,3266,3269],{"className":3267,"code":3268,"language":255,"meta":256},[253],"webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/vulnerable_components/VulnerableComponentsLesson.java#L37-68\n\nAttackResult completed(@RequestParam String payload) {\n        XStream xstream = new XStream(new DomDriver());\n        xstream.setClassLoader(Contact.class.getClassLoader());\n\n        xstream.processAnnotations(Contact.class);\n...\n\n        try {\n//          System.out.println(\"Payload:\" + payload);\n            Contact expl = (Contact) xstream.fromXML(payload);\n",[232,3270,3268],{"__ignoreMap":256},[12,3272,3273,264],{},[227,3274,263],{},[12,3276,3277],{},[227,3278,269],{},[117,3280,3281],{},[37,3282,593],{},[12,3284,3285],{},[227,3286,279],{},[12,3288,3212,3289,3291,3292,3294,3295,3297],{},[3214,3290,3216],{}," trigger on the exact line, but would be used in combination with a dependency scanning tool to identify the vulnerable ",[232,3293,3263],{}," component. It may also model the ",[232,3296,3263],{}," library to determine if XXE injection attacks are possible.",[12,3299,3300],{},[227,3301,287],{},[12,3303,3304,3305,3308,3309,3312],{},"A DAST tool may not attempt XML attacks since the form gives no hint that the expected form should POST as XML; the default content-type is ",[232,3306,3307],{},"application/x-www-form-urlencoded; charset=UTF-8"," with the parameter name of ",[232,3310,3311],{},"payload",". However some DAST tools may attempt XXE attacks in all parameter value types, regardless of content-type.",[12,3314,3315,300,3317],{},[227,3316,299],{},[232,3318,3319],{},"payload=\u003C?xml version=\"1.0\"?>\u003C!DOCTYPE text [\u003C!ENTITY xxe SYSTEM \"http://192.168.2.249:9090/test\">]>\u003Ccomment>\u003Ctext>&xxe;\u003C/text>\u003C/comment>",[210,3321],{},[26,3323,3325],{"id":3324},"a82013-request-forgeries","(A8:2013) Request Forgeries",[210,3327],{},[213,3329,3330,3332,3336,3343,3348,3356,3360,3363,3369,3373,3377,3381,3385,3394,3408,3410,3414,3421,3426,3430,3434,3437,3443,3447,3451,3455,3459,3465,3469,3474,3476,3480,3487,3492,3496,3500,3517,3523,3527,3531,3535,3539,3545,3550,3552,3556,3563,3568,3572,3576,3579,3585,3589,3593,3597,3601,3607,3612,3614,3618,3625,3630,3634,3637,3643,3647,3651,3655,3659,3662,3666,3669,3671,3675,3682,3687,3691,3697,3703,3707,3711,3715,3719,3732,3736,3742],{},[216,3331,219],{"markdown":218},[50,3333,3335],{"id":3334},"a82013-request-forgeries-cross-site-request-forgeries-basic-get-csrf-exercise","(A8:2013) Request Forgeries > Cross-Site Request Forgeries > Basic Get CSRF Exercise",[12,3337,3338,230,3340],{},[227,3339,229],{},[232,3341,3342],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CSRF.lesson/2",[12,3344,3345,3347],{},[227,3346,239],{}," - webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFConfirmFlag1.java",[117,3349,3350,3353],{},[37,3351,3352],{},"webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFGetFlag.java",[37,3354,3355],{},"webgoat-container/src/main/java/org/owasp/webgoat/WebSecurityConfig.java",[12,3357,3358],{},[227,3359,245],{},[12,3361,3362],{},"This lesson demonstrates exploiting a form that is not protected by anti-CSRF measures.",[250,3364,3367],{"className":3365,"code":3366,"language":255,"meta":256},[253],"webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFGetFlag.java#L49-51\n\n@RequestMapping(path = \"/csrf/basic-get-flag\", produces = {\"application/json\"}, method = RequestMethod.POST)\n@ResponseBody\npublic Map\u003CString, Object> invoke(HttpServletRequest req) {\n    ...\n\nwebgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFConfirmFlag1.java#L45-47\n\n@PostMapping(path = \"/csrf/confirm-flag-1\", produces = {\"application/json\"})\n@ResponseBody\npublic AttackResult completed(String confirmFlagVal) {\n...\n\nwebgoat-container/src/main/java/org/owasp/webgoat/WebSecurityConfig.java#L72\n    ...\n    security.and().csrf().disable();\n    ...\n",[232,3368,3366],{"__ignoreMap":256},[12,3370,3371,264],{},[227,3372,263],{},[12,3374,3375],{},[227,3376,269],{},[117,3378,3379],{},[37,3380,593],{},[12,3382,3383],{},[227,3384,279],{},[12,3386,3387,3388,3391,3392],{},"Provided the target web framework has been modeled, it should contain signatures to determine that the service has been configured with anti-CSRF protections enabled. Depending on the framework, it may also look at each individual request mapping to determine vulnerability. In this case the ",[232,3389,3390],{},"WebSecurityConfig.java"," explicitly disabled CSRF protections.\n",[227,3393,287],{},[12,3395,3396,3397,3400,3401,619,3404,3407],{},"DAST tools usually look at the ",[232,3398,3399],{},"\u003Cform>"," tag definition and try to identify any \"CSRF like\" tokens exist in parameters. Some DAST tools may also inspect the request itself to identify anti-CSRF tokens. Most DAST tools will likely flag both the ",[232,3402,3403],{},"/WebGoat/csrf/basic-get-flag",[232,3405,3406],{},"/WebGoat/csrf/confirm-flag-1"," as being vulnerable.",[210,3409],{},[50,3411,3413],{"id":3412},"a82013-request-forgeries-cross-site-request-forgeries-post-a-review-on-someone-elses-behalf","(A8:2013) Request Forgeries > Cross-Site Request Forgeries > Post a review on someone else’s behalf",[12,3415,3416,230,3418],{},[227,3417,229],{},[232,3419,3420],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CSRF.lesson/3",[12,3422,3423,3425],{},[227,3424,239],{}," - webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/ForgedReviews.java",[117,3427,3428],{},[37,3429,3355],{},[12,3431,3432],{},[227,3433,245],{},[12,3435,3436],{},"This lesson demonstrates exploiting a form that includes a weak form of anti-CSRF measures, as the CSRF token is a hardcoded value.",[250,3438,3441],{"className":3439,"code":3440,"language":255,"meta":256},[253],"webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/ForgedReviews.java#L78-102\n\npublic AttackResult createNewReview(String reviewText, Integer stars, String validateReq, HttpServletRequest request) {\n    final String host = (request.getHeader(\"host\") == null) ? \"NULL\" : request.getHeader(\"host\");\n    final String referer = (request.getHeader(\"referer\") == null) ? \"NULL\" : request.getHeader(\"referer\");\n    final String[] refererArr = referer.split(\"/\");\n\n    Review review = new Review();\n    review.setText(reviewText);\n    review.setDateTime(DateTime.now().toString(fmt));\n    review.setUser(webSession.getUserName());\n    review.setStars(stars);\n    var reviews = userReviews.getOrDefault(webSession.getUserName(), new ArrayList\u003C>());\n    reviews.add(review);\n    userReviews.put(webSession.getUserName(), reviews);\n    //short-circuit\n    if (validateReq == null || !validateReq.equals(weakAntiCSRF)) {\n        return failed(this).feedback(\"csrf-you-forgot-something\").build();\n    }\n    //we have the spoofed files\n    if (referer != \"NULL\" && refererArr[2].equals(host)) {\n        return failed(this).feedback(\"csrf-same-host\").build();\n    } else {\n        return success(this).feedback(\"csrf-review.success\").build(); //feedback(\"xss-stored-comment-failure\")\n    }\n}\n\nwebgoat-container/src/main/java/org/owasp/webgoat/WebSecurityConfig.java#L72\n    ...\n    security.and().csrf().disable();\n    ...\n",[232,3442,3440],{"__ignoreMap":256},[12,3444,3445,264],{},[227,3446,263],{},[12,3448,3449],{},[227,3450,269],{},[117,3452,3453],{},[37,3454,274],{},[12,3456,3457],{},[227,3458,279],{},[12,3460,3461,3462,3464],{},"Provided the target web framework has been modeled it should contain signatures to determine that the service has been configured with anti-CSRF protections enabled. Depending on the framework it may also look at each individual request mapping to determine vulnerability. In this case the ",[232,3463,3390],{}," explicitly disabled CSRF protections. Most likely a SAST tool will completely ignore the hard coded value check.",[12,3466,3467],{},[227,3468,287],{},[12,3470,3396,3471,3473],{},[232,3472,3399],{}," tag definition and try to identify any \"CSRF like\" tokens exist in parameters. Some DAST tools may also inspect the request itself to identify anti-CSRF tokens. In this case a DAST tool may be confused by the seemingly configured CSRF token, when in reality the value is hard coded. A DAST tool will need to do an active request and compare the results to see if the CSRF token is ever updated/changed.",[210,3475],{},[50,3477,3479],{"id":3478},"a82013-request-forgeries-cross-site-request-forgeries-csrf-and-content-type","(A8:2013) Request Forgeries > Cross-Site Request Forgeries > CSRF and content-type",[12,3481,3482,230,3484],{},[227,3483,229],{},[232,3485,3486],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CSRF.lesson/6",[12,3488,3489,3491],{},[227,3490,239],{}," - webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFFeedback.java",[117,3493,3494],{},[37,3495,3355],{},[12,3497,3498],{},[227,3499,245],{},[12,3501,3502,3503,3506,3507,3510,3511,76,3514,133],{},"This lesson demonstrates exploiting a CSRF vulnerable form that calls an endpoint which doesn't validate the content-type properly. Newer browsers will append a ",[232,3504,3505],{},"="," to the end of ",[232,3508,3509],{},"text/plain"," forms where only the name value exists. This form is still vulnerable to CSRF if attackers use ",[232,3512,3513],{},"XMLHttpRequest",[232,3515,3516],{},"navigator.sendBeacon",[250,3518,3521],{"className":3519,"code":3520,"language":255,"meta":256},[253],"webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFFeedback.java#L57-74\n\npublic AttackResult completed(HttpServletRequest request, @RequestBody String feedback) {\n        try {\n            objectMapper.enable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);\n            objectMapper.enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);\n            objectMapper.enable(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS);\n            objectMapper.enable(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY);\n            objectMapper.enable(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES);\n            objectMapper.enable(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);\n            objectMapper.readValue(feedback.getBytes(), Map.class);\n        } catch (IOException e) {\n            return failed(this).feedback(ExceptionUtils.getStackTrace(e)).build();\n        }\n        boolean correctCSRF = requestContainsWebGoatCookie(request.getCookies()) && request.getContentType().contains(MediaType.TEXT_PLAIN_VALUE);\n        correctCSRF &= hostOrRefererDifferentHost(request);\n        if (correctCSRF) {\n            String flag = UUID.randomUUID().toString();\n            userSessionData.setValue(\"csrf-feedback\", flag);\n            return success(this).feedback(\"csrf-feedback-success\").feedbackArgs(flag).build();\n    ...\n\nwebgoat-container/src/main/java/org/owasp/webgoat/WebSecurityConfig.java#L72\n    ...\n    security.and().csrf().disable();\n    ...\n",[232,3522,3520],{"__ignoreMap":256},[12,3524,3525,264],{},[227,3526,263],{},[12,3528,3529],{},[227,3530,269],{},[117,3532,3533],{},[37,3534,593],{},[12,3536,3537],{},[227,3538,279],{},[12,3540,3461,3541,3391,3543],{},[232,3542,3390],{},[227,3544,287],{},[12,3546,3396,3547,3549],{},[232,3548,3399],{}," tag definition and try to identify any \"CSRF like\" tokens exist in parameters. Some DAST tools may also inspect the request itself to identify anti-CSRF tokens. In this case a DAST tool would treat this form the same as any other and flag it as vulnerable to CSRF regardless of content-type.",[210,3551],{},[50,3553,3555],{"id":3554},"a82013-request-forgeries-cross-site-request-forgeries-login-csrf-attack","(A8:2013) Request Forgeries > Cross-Site Request Forgeries > Login CSRF attack",[12,3557,3558,230,3560],{},[227,3559,229],{},[232,3561,3562],{},"http://localhost:8080/WebGoat/start.mvc#lesson/CSRF.lesson/7",[12,3564,3565,3567],{},[227,3566,239],{}," - webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFLogin.java",[117,3569,3570],{},[37,3571,3355],{},[12,3573,3574],{},[227,3575,245],{},[12,3577,3578],{},"This lesson demonstrates exploiting a CSRF vulnerable form to force a victim to login under the attackers account.",[250,3580,3583],{"className":3581,"code":3582,"language":255,"meta":256},[253],"webgoat-lessons/csrf/src/main/java/org/owasp/webgoat/csrf/CSRFLogin.java#50-57\n\npublic AttackResult completed(HttpServletRequest request) {\n    String userName = request.getUserPrincipal().getName();\n    if (userName.startsWith(\"csrf\")) {\n        markAssignmentSolvedWithRealUser(userName.substring(\"csrf-\".length()));\n        return success(this).feedback(\"csrf-login-success\").build();\n    }\n    return failed(this).feedback(\"csrf-login-failed\").feedbackArgs(userName).build();\n}\n\nwebgoat-container/src/main/java/org/owasp/webgoat/WebSecurityConfig.java#L72\n    ...\n    security.and().csrf().disable();\n    ...\n",[232,3584,3582],{"__ignoreMap":256},[12,3586,3587,264],{},[227,3588,263],{},[12,3590,3591],{},[227,3592,269],{},[117,3594,3595],{},[37,3596,593],{},[12,3598,3599],{},[227,3600,279],{},[12,3602,3461,3603,3391,3605],{},[232,3604,3390],{},[227,3606,287],{},[12,3608,3396,3609,3611],{},[232,3610,3399],{}," tag definition and try to identify any \"CSRF like\" tokens exist in parameters. Some DAST tools may also inspect the request itself to identify anti-CSRF tokens. In this case a DAST tool would treat this form the same as any other and flag it as vulnerable to CSRF.",[210,3613],{},[50,3615,3617],{"id":3616},"a82013-request-forgeries-server-side-request-forgery-change-the-url-to-display-jerry","(A8:2013) Request Forgeries > Server-Side Request Forgery > Change the URL to display Jerry",[12,3619,3620,230,3622],{},[227,3621,229],{},[232,3623,3624],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SSRF.lesson/1",[12,3626,3627,3629],{},[227,3628,239],{}," - webgoat-lessons/ssrf/src/main/java/org/owasp/webgoat/ssrf/SSRFTask1.java",[12,3631,3632],{},[227,3633,245],{},[12,3635,3636],{},"This lesson does not contain a real vulnerability, it is only for demonstration purposes for modifying parameters.",[250,3638,3641],{"className":3639,"code":3640,"language":255,"meta":256},[253],"webgoat-lessons/ssrf/src/main/java/org/owasp/webgoat/ssrf/SSRFTask1.java#44-66\n\nprotected AttackResult stealTheCheese(String url) {\n    try {\n        StringBuffer html = new StringBuffer();\n\n        if (url.matches(\"images/tom.png\")) {\n            html.append(\"\u003Cimg class=\\\"image\\\" alt=\\\"Tom\\\" src=\\\"images/tom.png\\\" width=\\\"25%\\\" height=\\\"25%\\\">\");\n            return failed(this)\n                    .feedback(\"ssrf.tom\")\n                    .output(html.toString())\n                    .build();\n        } else if (url.matches(\"images/jerry.png\")) {\n            html.append(\"\u003Cimg class=\\\"image\\\" alt=\\\"Jerry\\\" src=\\\"images/jerry.png\\\" width=\\\"25%\\\" height=\\\"25%\\\">\");\n            return success(this)\n                    .feedback(\"ssrf.success\")\n                    .output(html.toString())\n                    .build();\n        } else {\n            html.append(\"\u003Cimg class=\\\"image\\\" alt=\\\"Silly Cat\\\" src=\\\"images/cat.jpg\\\">\");\n            return failed(this)\n                    .feedback(\"ssrf.failure\")\n                    .output(html.toString())\n                    .build();\n        }\n",[232,3642,3640],{"__ignoreMap":256},[12,3644,3645,477],{},[227,3646,263],{},[12,3648,3649],{},[227,3650,269],{},[117,3652,3653],{},[37,3654,486],{},[12,3656,3657],{},[227,3658,279],{},[12,3660,3661],{},"This endpoint does not contain any SSRF issues, it simply does a string match and returns different results.",[12,3663,3664],{},[227,3665,287],{},[12,3667,3668],{},"This endpoint does not contain any SSRF issues.",[210,3670],{},[50,3672,3674],{"id":3673},"a82013-request-forgeries-server-side-request-forgery","(A8:2013) Request Forgeries > Server-Side Request Forgery >",[12,3676,3677,230,3679],{},[227,3678,229],{},[232,3680,3681],{},"http://localhost:8080/WebGoat/start.mvc#lesson/SSRF.lesson/2",[12,3683,3684,3686],{},[227,3685,239],{}," - webgoat-lessons/ssrf/src/main/java/org/owasp/webgoat/ssrf/SSRFTask2.java",[12,3688,3689],{},[227,3690,245],{},[12,3692,3693,3694,133],{},"This lesson is for exploiting SSRF but limits the user to a single URL that must exactly match ",[232,3695,3696],{},"http://ifconfig.pro",[250,3698,3701],{"className":3699,"code":3700,"language":255,"meta":256},[253],"webgoat-lessons/ssrf/src/main/java/org/owasp/webgoat/ssrf/SSRFTask2.java#L49-74\n\nprotected AttackResult furBall(String url) {\n        try {\n            StringBuffer html = new StringBuffer();\n\n            if (url.matches(\"http://ifconfig.pro\")) {\n                URL u = new URL(url);\n                URLConnection urlConnection = u.openConnection();\n                BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));\n                String inputLine;\n\n                while ((inputLine = in.readLine()) != null) {\n                    html.append(inputLine);\n                }\n                in.close();\n\n                return success(this)\n                        .feedback(\"ssrf.success\")\n                        .output(html.toString())\n                        .build();\n            } else {\n                html.append(\"\u003Cimg class=\\\"image\\\" alt=\\\"image post\\\" src=\\\"images/cat.jpg\\\">\");\n                return failed(this)\n                        .feedback(\"ssrf.failure\")\n                        .output(html.toString())\n                        .build();\n            }\n\n",[232,3702,3700],{"__ignoreMap":256},[12,3704,3705,264],{},[227,3706,263],{},[12,3708,3709],{},[227,3710,269],{},[117,3712,3713],{},[37,3714,486],{},[12,3716,3717],{},[227,3718,279],{},[12,3720,3721,3722,3725,3726,3729,3730],{},"A SAST tool may report that this endpoint is vulnerable due to the user provided ",[232,3723,3724],{},"url"," parameter being used in a ",[232,3727,3728],{},"URLConnection.openConnection()"," call. In reality, this is not an exploitable flaw since the URL must exactly match ",[232,3731,3696],{},[12,3733,3734],{},[227,3735,287],{},[12,3737,3738,3739,3741],{},"A DAST tool attempting SSRF injection attacks will most likely use a callback server to receive a forced request from the target application. Since the value is technically hardcoded, there is no way for a DAST tool to know if the endpoint is using a user provided value in construction of the ",[232,3740,3728],{}," call.",[210,3743],{},[26,3745,3747],{"id":3746},"client-side","Client side",[210,3749],{},[26,3751,3753],{"id":3752},"these-lessons-are-just-demonstrations-of-bypassing-client-side-restrictions-since-there-is-no-real-business-logic-to-exploit-they-do-not-contain-any-real-exploitable-flaws","These lessons are just demonstrations of bypassing client side restrictions – since there is no real business logic to exploit they do not contain any real exploitable flaws.",[26,3755,3757],{"id":3756},"challenges","Challenges",[210,3759],{},[213,3761,3762,3764,3768,3775,3780,3788,3793,3796,3802,3806,3810,3814,3818,3824,3828,3832,3836,3843,3848,3852,3859,3865,3869,3873,3877,3881,3891,3895,3904,3906,3910,3917,3922,3926,3937,3943,3947,3951,3956,3960,3970,3974,3983,3985,3989,3996,4001,4005,4016,4022,4026,4030,4034,4038,4041,4045,4054],{},[216,3763,219],{"markdown":218},[50,3765,3767],{"id":3766},"challenges-admin-lost-password","Challenges > Admin lost password",[12,3769,3770,230,3772],{},[227,3771,229],{},[232,3773,3774],{},"http://localhost:8080/WebGoat/start.mvc#lesson/Challenge1.lesson/1",[12,3776,3777,3779],{},[227,3778,239],{}," - webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge1/Assignment1.java",[117,3781,3782,3785],{},[37,3783,3784],{},"webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge1/ImageServlet.java",[37,3786,3787],{},"webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/SolutionConstants.java",[12,3789,3790],{},[227,3791,3792],{},"Challenge:",[12,3794,3795],{},"The purpose of this challenge is to find the hidden pin code embedded in the logo and replace the hardcoded password's 1234 with the value.",[250,3797,3800],{"className":3798,"code":3799,"language":255,"meta":256},[253],"\nwebgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge1/ImageServlet.java#L23-37\n\nprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n        throws ServletException, IOException {\n\n    byte[] in = new ClassPathResource(\"images/webgoat2.png\").getInputStream().readAllBytes();\n\n    String pincode = String.format(\"%04d\", PINCODE);\n\n    in[81216]=(byte) pincode.charAt(0);\n    in[81217]=(byte) pincode.charAt(1);\n    in[81218]=(byte) pincode.charAt(2);\n    in[81219]=(byte) pincode.charAt(3);\n\n    response.setContentType(MediaType.IMAGE_PNG_VALUE);\n    FileCopyUtils.copy(in, response.getOutputStream());\n}\n\nwebgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/SolutionConstants.java#L34-36\n\nString PASSWORD = \"!!webgoat_admin_1234!!\";\nString PASSWORD_TOM = \"thisisasecretfortomonly\";\nString ADMIN_PASSWORD_LINK = \"375afe1104f4a487a73823c50a9292a2\";\n",[232,3801,3799],{"__ignoreMap":256},[12,3803,3804,2269],{},[227,3805,263],{},[12,3807,3808],{},[227,3809,269],{},[117,3811,3812],{},[37,3813,486],{},[12,3815,3816],{},[227,3817,279],{},[12,3819,3820,3821,133],{},"There is no real vulnerability here for a SAST tool to alert on that would match the purpose of the assignment. However, SAST tools will most likely flag hardcoded credentials in ",[232,3822,3823],{},"SolutionConstants.java",[12,3825,3826],{},[227,3827,287],{},[26,3829,3831],{"id":3830},"there-is-no-real-vulnerability-here-for-a-dast-tool-to-alert-on-that-would-match-the-purpose-of-the-assignment","There is no real vulnerability here for a DAST tool to alert on that would match the purpose of the assignment.",[50,3833,3835],{"id":3834},"challenges-without-password","Challenges > Without password",[12,3837,3838,230,3840],{},[227,3839,229],{},[232,3841,3842],{},"http://localhost:8080/WebGoat/start.mvc#lesson/Challenge5.lesson",[12,3844,3845,3847],{},[227,3846,239],{}," - webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge5/Assignment5.java",[12,3849,3850],{},[227,3851,3792],{},[12,3853,3854,3855,3858],{},"The purpose of this challenge is to login as ",[232,3856,3857],{},"Larry"," without knowing his password. This can be achieved by exploiting a SQL Injection vulnerability.",[250,3860,3863],{"className":3861,"code":3862,"language":255,"meta":256},[253],"\nwebgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge5/Assignment5.java#L51-68\n\npublic AttackResult login(@RequestParam String username_login, @RequestParam String password_login) throws Exception {\n        if (!StringUtils.hasText(username_login) || !StringUtils.hasText(password_login)) {\n            return failed(this).feedback(\"required4\").build();\n        }\n        if (!\"Larry\".equals(username_login)) {\n            return failed(this).feedback(\"user.not.larry\").feedbackArgs(username_login).build();\n        }\n        try (var connection = dataSource.getConnection()) {\n            PreparedStatement statement = connection.prepareStatement(\"select password from challenge_users where userid = '\" + username_login + \"' and password = '\" + password_login + \"'\");\n            ResultSet resultSet = statement.executeQuery();\n\n            if (resultSet.next()) {\n                return success(this).feedback(\"challenge.solved\").feedbackArgs(Flag.FLAGS.get(5)).build();\n            } else {\n                return failed(this).feedback(\"challenge.close\").build();\n            }\n        }\n    }\n",[232,3864,3862],{"__ignoreMap":256},[12,3866,3867,264],{},[227,3868,263],{},[12,3870,3871],{},[227,3872,269],{},[117,3874,3875],{},[37,3876,1407],{},[12,3878,3879],{},[227,3880,279],{},[12,3882,3883,3884,619,3887,3890],{},"While the SQL query is a prepared statement, ",[232,3885,3886],{},"username_login",[232,3888,3889],{},"password_login"," fields are dynamically inserted into the query statement. A SAST tool should identify that the query string is concatenated with user input on line 59.",[12,3892,3893],{},[227,3894,287],{},[12,3896,3897,3898,3900,3901,3903],{},"A DAST tool would most likely not find this vulnerability due to the username being checked against the hardcoded ",[232,3899,3857],{}," value. A DAST tool would need to be configured for this particular page to use the ",[232,3902,3857],{}," username, and then attempt SQL Injection.",[210,3905],{},[50,3907,3909],{"id":3908},"challenges-admin-password-reset","Challenges > Admin password reset",[12,3911,3912,230,3914],{},[227,3913,229],{},[232,3915,3916],{},"http://localhost:8080/WebGoat/start.mvc#lesson/Challenge7.lesson",[12,3918,3919,3921],{},[227,3920,239],{}," - webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge7/Assignment7.java",[12,3923,3924],{},[227,3925,3792],{},[12,3927,3928,3929,3932,3933,3936],{},"The purpose of this challenge is to find the synthetic ",[232,3930,3931],{},".git"," repository accessible at the ",[232,3934,3935],{},"/WebGoat/challenge/7/.git"," endpoint. Then extract the git files, decompile classes and run them to generate the password reset link password.",[250,3938,3941],{"className":3939,"code":3940,"language":255,"meta":256},[253],"webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge7/Assignment7.java#L76-80\n\n@GetMapping(value = \"/challenge/7/.git\", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)\n@ResponseBody\npublic ClassPathResource git() {\n    return new ClassPathResource(\"challenge7/git.zip\");\n}\n\nwebgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/SolutionConstants.java#L34-36\n\nString PASSWORD = \"!!webgoat_admin_1234!!\";\nString PASSWORD_TOM = \"thisisasecretfortomonly\";\nString ADMIN_PASSWORD_LINK = \"375afe1104f4a487a73823c50a9292a2\";\n",[232,3942,3940],{"__ignoreMap":256},[12,3944,3945,2269],{},[227,3946,263],{},[12,3948,3949],{},[227,3950,269],{},[117,3952,3953],{},[37,3954,3955],{},"Possible (different issue)",[12,3957,3958],{},[227,3959,279],{},[12,3961,3962,3963,3966,3967,3969],{},"This is a fake vulnerability that hard codes a git index file to a spring ",[232,3964,3965],{},"GetMapping"," endpoint. However, a SAST tool would most likely flag the hardcoded credentials in ",[232,3968,3823],{}," on line 36.",[12,3971,3972],{},[227,3973,287],{},[12,3975,3976,3977,3979,3980,3982],{},"DAST tools commonly look for backup or known files, ",[232,3978,3931],{}," is usually ne of them. A DAST tool would attempt to find these files in each directory path and should report that the ",[232,3981,3935],{}," git index is accessible. While it may attempt to decompile classes it would be unable to know that it's necessary to run a particular file.",[210,3984],{},[50,3986,3988],{"id":3987},"challenges-without-account","Challenges > Without account",[12,3990,3991,230,3993],{},[227,3992,229],{},[232,3994,3995],{},"http://localhost:8080/WebGoat/start.mvc#lesson/Challenge8.lesson",[12,3997,3998,4000],{},[227,3999,239],{}," - webgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge8/Assignment8.java",[12,4002,4003],{},[227,4004,3792],{},[12,4006,4007,4008,4011,4012,4015],{},"The purpose of this challenge is to add a vote without logging in. This is a synthetic vulnerability due to the fact that it only checks if the request is a ",[232,4009,4010],{},"GET"," request but there's no real authorization checks. It is \"exploitable\" because it does not account for ",[232,4013,4014],{},"HEAD"," request method types.",[250,4017,4020],{"className":4018,"code":4019,"language":255,"meta":256},[253],"\nwebgoat-lessons/challenge/src/main/java/org/owasp/webgoat/challenges/challenge7/Assignment7.java#L76-80\n\n@GetMapping(value = \"/challenge/8/vote/{stars}\", produces = MediaType.APPLICATION_JSON_VALUE)\n    @ResponseBody\n    public ResponseEntity\u003C?> vote(@PathVariable(value = \"stars\") int nrOfStars, HttpServletRequest request) {\n        //Simple implementation of VERB Based Authentication\n        String msg = \"\";\n        if (request.getMethod().equals(\"GET\")) {\n            var json = Map.of(\"error\", true, \"message\", \"Sorry but you need to login first in order to vote\");\n            return ResponseEntity.status(200).body(json);\n        }\n        Integer allVotesForStar = votes.getOrDefault(nrOfStars, 0);\n        votes.put(nrOfStars, allVotesForStar + 1);\n        return ResponseEntity.ok().header(\"X-Flag\", \"Thanks for voting, your flag is: \" + Flag.FLAGS.get(8)).build();\n    }\n",[232,4021,4019],{"__ignoreMap":256},[12,4023,4024,477],{},[227,4025,263],{},[12,4027,4028],{},[227,4029,269],{},[117,4031,4032],{},[37,4033,1407],{},[12,4035,4036],{},[227,4037,279],{},[12,4039,4040],{},"Since this is a synthetic vulnerability with no references to any authorization frameworks, there is nothing for a SAST tool to look for.",[12,4042,4043],{},[227,4044,287],{},[12,4046,4047,4048,4050,4051,4053],{},"A DAST tool may attempt to switch request method types and do differential analysis to see if a ",[232,4049,4014],{}," request illicit a different response than a ",[232,4052,4010],{}," request.",[210,4055],{},[26,4057,4059],{"id":4058},"flaws-outside-of-lessons","Flaws outside of lessons",[12,4061,4062],{},"There are a large number of flaws that are not necessarily part of the lesson. However, SAST and DAST tools may still report on these issues as they are exploitable.\nSince tools will report on these issues, it is important to have a full set of all actual vulnerabilities that exist in WebGoat, or in any system used for benchmarking.",[26,4064,4066],{"id":4065},"conclusion","Conclusion",[12,4068,4069,4070,619,4075,4080],{},"While in GitLab's proprietary format, we decided to release our results so that other organizations using WebGoat as a target can identify which flaws are legitimate for both ",[16,4071,4074],{"href":4072,"rel":4073},"https://gitlab.com/gitlab-org/vulnerability-research/blog/-/blob/master/security-benchmarking-webgoat/webgoat-expected-sast-results.json",[],"SAST",[16,4076,4079],{"href":4077,"rel":4078},"https://gitlab.com/gitlab-org/vulnerability-research/blog/-/blob/master/security-benchmarking-webgoat/webgoat-expected-dast-results.json",[],"DAST"," based discovery.\nWebGoat is an excellent tool for learning about web application security. If your organization decides to use it to compare DAST and SAST tools you must be aware of the limitations and caveats during your analysis.\nWebGoat is by no means a \"real application\", while it does contain a common structure of a Spring Boot based application, its flaws are sometimes synthetic and code flow is not indicative of how real applications are built.",[12,4082,4083],{},"GitLab recommends using more than one application as apart of your benchmarking process. This should include multiple languages, features and the levels of complexity that matches the applications used in your organization.",[12,4085,4086,4087,4092,4093],{},"Cover image by ",[16,4088,4091],{"href":4089,"rel":4090},"https://unsplash.com/@bannon15",[],"Bannon Morrissy"," on ",[16,4094,4097],{"href":4095,"rel":4096},"https://unsplash.com",[],"Unsplash",{"title":256,"searchDepth":4099,"depth":4099,"links":4100},2,[4101,4108,4109,4110,4111,4129,4132,4135,4138,4141,4146,4151,4154,4159,4165,4167,4172,4175,4177,4181,4189,4190,4191,4194,4199,4200],{"id":28,"depth":4099,"text":29,"children":4102},[4103,4105,4106,4107],{"id":52,"depth":4104,"text":53},3,{"id":59,"depth":4104,"text":60},{"id":66,"depth":4104,"text":67},{"id":88,"depth":4104,"text":89},{"id":98,"depth":4099,"text":99},{"id":111,"depth":4099,"text":112},{"id":154,"depth":4099,"text":155},{"id":207,"depth":4099,"text":208,"children":4112},[4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128],{"id":222,"depth":4104,"text":223},{"id":309,"depth":4104,"text":310},{"id":380,"depth":4104,"text":381},{"id":446,"depth":4104,"text":447},{"id":504,"depth":4104,"text":505},{"id":554,"depth":4104,"text":555},{"id":650,"depth":4104,"text":651},{"id":733,"depth":4104,"text":734},{"id":812,"depth":4104,"text":813},{"id":891,"depth":4104,"text":892},{"id":959,"depth":4104,"text":960},{"id":1033,"depth":4104,"text":1034},{"id":1105,"depth":4104,"text":1106},{"id":1198,"depth":4104,"text":1199},{"id":1291,"depth":4104,"text":1292},{"id":1365,"depth":4104,"text":1366},{"id":1460,"depth":4099,"text":1461,"children":4130},[4131],{"id":1464,"depth":4104,"text":1465},{"id":1542,"depth":4099,"text":1461,"children":4133},[4134],{"id":1545,"depth":4104,"text":1546},{"id":1632,"depth":4099,"text":1461,"children":4136},[4137],{"id":1635,"depth":4104,"text":1636},{"id":1740,"depth":4099,"text":1741,"children":4139},[4140],{"id":1750,"depth":4104,"text":1751},{"id":1808,"depth":4099,"text":1809,"children":4142},[4143,4144,4145],{"id":1812,"depth":4104,"text":1813},{"id":1889,"depth":4104,"text":1890},{"id":1956,"depth":4104,"text":1957},{"id":2007,"depth":4099,"text":2008,"children":4147},[4148,4149,4150],{"id":2011,"depth":4104,"text":2012},{"id":2099,"depth":4104,"text":2100},{"id":2160,"depth":4104,"text":2161},{"id":2226,"depth":4099,"text":2227,"children":4152},[4153],{"id":2238,"depth":4104,"text":2239},{"id":2294,"depth":4099,"text":2295,"children":4155},[4156,4157,4158],{"id":2304,"depth":4104,"text":2305},{"id":2391,"depth":4104,"text":2392},{"id":2478,"depth":4104,"text":2479},{"id":2545,"depth":4099,"text":2546,"children":4160},[4161,4162,4163,4164],{"id":2555,"depth":4104,"text":2556},{"id":2611,"depth":4104,"text":2612},{"id":2667,"depth":4104,"text":2668},{"id":2733,"depth":4104,"text":2734},{"id":2792,"depth":4099,"text":4166},"IDOR-based attacks can be difficult for DAST tools to detect. The DAST tool would need to be configured to treat the /WebGoat/IDOR/login page as a login form to be able to successfully set the additional server side session data. After which it would somehow need to determine that the edit and view profile endpoint at /WebGoat/IDOR/profile/{user} should have the {user} field replaced with the userid of the same user, and then replaced as a different user to trigger the flaw.",{"id":2807,"depth":4099,"text":2808,"children":4168},[4169,4170,4171],{"id":2817,"depth":4104,"text":2818},{"id":2906,"depth":4104,"text":2907},{"id":2965,"depth":4104,"text":2966},{"id":3070,"depth":4099,"text":3071,"children":4173},[4174],{"id":3080,"depth":4104,"text":3081},{"id":3149,"depth":4099,"text":4176},"DAST tools usually work off of intercepting requests and analyzing parameter values to determine what to inject. The /WebGoat/InsecureDeserialization/task endpoint is never triggered with a valid object, only a reference to what is expected exists in the HTML output. Due to this, there is no way for a DAST tool to know that this endpoint expects a serialized java object, and hence would not be able to attack it.",{"id":3157,"depth":4099,"text":3158,"children":4178},[4179,4180],{"id":3167,"depth":4104,"text":3168},{"id":3240,"depth":4104,"text":3241},{"id":3324,"depth":4099,"text":3325,"children":4182},[4183,4184,4185,4186,4187,4188],{"id":3334,"depth":4104,"text":3335},{"id":3412,"depth":4104,"text":3413},{"id":3478,"depth":4104,"text":3479},{"id":3554,"depth":4104,"text":3555},{"id":3616,"depth":4104,"text":3617},{"id":3673,"depth":4104,"text":3674},{"id":3746,"depth":4099,"text":3747},{"id":3752,"depth":4099,"text":3753},{"id":3756,"depth":4099,"text":3757,"children":4192},[4193],{"id":3766,"depth":4104,"text":3767},{"id":3830,"depth":4099,"text":3831,"children":4195},[4196,4197,4198],{"id":3834,"depth":4104,"text":3835},{"id":3908,"depth":4104,"text":3909},{"id":3987,"depth":4104,"text":3988},{"id":4058,"depth":4099,"text":4059},{"id":4065,"depth":4099,"text":4066},"security","2020-08-11","When tasked to compare security tools, it's critical to understand what's a fair benchmark. We take you step by step through WebGoat's lessons and compare them to SAST and DAST results.","md",null,false,"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749678166/Blog/Hero%20Images/benchmarking.jpg",{},true,"/en-us/blog/how-to-benchmark-security-tools",{"title":5,"description":4203,"ogTitle":5,"ogDescription":4203,"noIndex":4206,"ogImage":4207,"ogUrl":4212,"ogSiteName":4213,"ogType":4214,"canonicalUrls":4212},"https://about.gitlab.com/blog/how-to-benchmark-security-tools","https://about.gitlab.com","article","how-to-benchmark-security-tools","en-us/blog/how-to-benchmark-security-tools",[4201,4218,4219],"security research","testing","BlogPost","3d3VrmtSirKvSWUWvZMZvnh9XLyiWRGs6wPy_hk6ELQ",{"logo":4223,"freeTrial":4227,"sales":4232,"login":4237,"items":4242,"search":4569,"minimal":4600,"duo":4619,"switchNav":4628,"pricingDeployment":4639},{"config":4224},{"href":1666,"dataGaName":4225,"dataGaLocation":4226},"gitlab logo","header",{"text":4228,"config":4229},"Get free trial",{"href":4230,"dataGaName":4231,"dataGaLocation":4226},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":4233,"config":4234},"Request a demo",{"href":4235,"dataGaName":4236,"dataGaLocation":4226},"/sales/?contact-topic=request-demo","sales",{"text":4238,"config":4239},"Sign in",{"href":4240,"dataGaName":4241,"dataGaLocation":4226},"https://gitlab.com/users/sign_in/","sign in",[4243,4272,4372,4377,4491,4547],{"text":4244,"config":4245,"menu":4247},"Platform",{"dataNavLevelOne":4246},"platform",{"type":4248,"columns":4249},"cards",[4250,4256,4264],{"title":4244,"description":4251,"link":4252},"The intelligent orchestration platform for DevSecOps",{"text":4253,"config":4254},"Explore our Platform",{"href":4255,"dataGaName":4246,"dataGaLocation":4226},"/platform/",{"title":4257,"description":4258,"link":4259},"GitLab Duo Agent Platform","Agentic AI for the entire software lifecycle",{"text":4260,"config":4261},"Meet GitLab Duo",{"href":4262,"dataGaName":4263,"dataGaLocation":4226},"/gitlab-duo-agent-platform/","gitlab duo agent platform",{"title":4265,"description":4266,"link":4267},"Why GitLab","See the top reasons enterprises choose GitLab",{"text":4268,"config":4269},"Learn more",{"href":4270,"dataGaName":4271,"dataGaLocation":4226},"/why-gitlab/","why gitlab",{"text":4273,"left":4209,"config":4274,"menu":4276},"Product",{"dataNavLevelOne":4275},"solutions",{"type":4277,"link":4278,"columns":4282,"feature":4351},"lists",{"text":4279,"config":4280},"View all Solutions",{"href":4281,"dataGaName":4275,"dataGaLocation":4226},"/solutions/",[4283,4307,4330],{"title":4284,"description":4285,"link":4286,"items":4291},"Automation","CI/CD and automation to accelerate deployment",{"config":4287},{"icon":4288,"href":4289,"dataGaName":4290,"dataGaLocation":4226},"AutomatedCodeAlt","/solutions/delivery-automation/","automated software delivery",[4292,4296,4299,4303],{"text":4293,"config":4294},"CI/CD",{"href":4295,"dataGaLocation":4226,"dataGaName":4293},"/solutions/continuous-integration/",{"text":4257,"config":4297},{"href":4262,"dataGaLocation":4226,"dataGaName":4298},"gitlab duo agent platform - product menu",{"text":4300,"config":4301},"Source Code Management",{"href":4302,"dataGaLocation":4226,"dataGaName":4300},"/solutions/source-code-management/",{"text":4304,"config":4305},"Automated Software Delivery",{"href":4289,"dataGaLocation":4226,"dataGaName":4306},"Automated software delivery",{"title":4308,"description":4309,"link":4310,"items":4315},"Security","Deliver code faster without compromising security",{"config":4311},{"href":4312,"dataGaName":4313,"dataGaLocation":4226,"icon":4314},"/solutions/application-security-testing/","security and compliance","ShieldCheckLight",[4316,4320,4325],{"text":4317,"config":4318},"Application Security Testing",{"href":4312,"dataGaName":4319,"dataGaLocation":4226},"Application security testing",{"text":4321,"config":4322},"Software Supply Chain Security",{"href":4323,"dataGaLocation":4226,"dataGaName":4324},"/solutions/supply-chain/","Software supply chain security",{"text":4326,"config":4327},"Software Compliance",{"href":4328,"dataGaName":4329,"dataGaLocation":4226},"/solutions/software-compliance/","software compliance",{"title":4331,"link":4332,"items":4337},"Measurement",{"config":4333},{"icon":4334,"href":4335,"dataGaName":4336,"dataGaLocation":4226},"DigitalTransformation","/solutions/visibility-measurement/","visibility and measurement",[4338,4342,4346],{"text":4339,"config":4340},"Visibility & Measurement",{"href":4335,"dataGaLocation":4226,"dataGaName":4341},"Visibility and Measurement",{"text":4343,"config":4344},"Value Stream Management",{"href":4345,"dataGaLocation":4226,"dataGaName":4343},"/solutions/value-stream-management/",{"text":4347,"config":4348},"Analytics & Insights",{"href":4349,"dataGaLocation":4226,"dataGaName":4350},"/solutions/analytics-and-insights/","Analytics and insights",{"title":4352,"type":4277,"items":4353},"GitLab for",[4354,4360,4366],{"text":4355,"config":4356},"Enterprise",{"icon":4357,"href":4358,"dataGaLocation":4226,"dataGaName":4359},"Building","/enterprise/","enterprise",{"text":4361,"config":4362},"Small Business",{"icon":4363,"href":4364,"dataGaLocation":4226,"dataGaName":4365},"Work","/small-business/","small business",{"text":4367,"config":4368},"Public Sector",{"icon":4369,"href":4370,"dataGaLocation":4226,"dataGaName":4371},"Organization","/solutions/public-sector/","public sector",{"text":4373,"config":4374},"Pricing",{"href":4375,"dataGaName":4376,"dataGaLocation":4226,"dataNavLevelOne":4376},"/pricing/","pricing",{"text":4378,"config":4379,"menu":4381},"Resources",{"dataNavLevelOne":4380},"resources",{"type":4277,"link":4382,"columns":4386,"feature":4480},{"text":4383,"config":4384},"View all resources",{"href":4385,"dataGaName":4380,"dataGaLocation":4226},"/resources/",[4387,4420,4447],{"title":4388,"items":4389},"Getting started",[4390,4395,4400,4405,4410,4415],{"text":4391,"config":4392},"Install",{"href":4393,"dataGaName":4394,"dataGaLocation":4226},"/install/","install",{"text":4396,"config":4397},"Quick start guides",{"href":4398,"dataGaName":4399,"dataGaLocation":4226},"/get-started/","quick setup checklists",{"text":4401,"config":4402},"Learn",{"href":4403,"dataGaLocation":4226,"dataGaName":4404},"https://university.gitlab.com/","learn",{"text":4406,"config":4407},"Product documentation",{"href":4408,"dataGaName":4409,"dataGaLocation":4226},"https://docs.gitlab.com/","product documentation",{"text":4411,"config":4412},"Best practice videos",{"href":4413,"dataGaName":4414,"dataGaLocation":4226},"/getting-started-videos/","best practice videos",{"text":4416,"config":4417},"Integrations",{"href":4418,"dataGaName":4419,"dataGaLocation":4226},"/integrations/","integrations",{"title":4421,"items":4422},"Discover",[4423,4428,4433,4438,4442],{"text":4424,"config":4425},"Customer success stories",{"href":4426,"dataGaName":4427,"dataGaLocation":4226},"/customers/","customer success stories",{"text":4429,"config":4430},"Blog",{"href":4431,"dataGaName":4432,"dataGaLocation":4226},"/blog/","blog",{"text":4434,"config":4435},"Demo Hub",{"href":4436,"dataGaName":4437,"dataGaLocation":4226},"/demo-hub/","demo hub",{"text":4439,"config":4440},"The Source",{"href":4441,"dataGaName":4432,"dataGaLocation":4226},"/the-source/",{"text":4443,"config":4444},"Remote",{"href":4445,"dataGaName":4446,"dataGaLocation":4226},"https://handbook.gitlab.com/handbook/company/culture/all-remote/","remote",{"title":4448,"items":4449},"Connect",[4450,4455,4460,4465,4470,4475],{"text":4451,"config":4452},"GitLab Services",{"href":4453,"dataGaName":4454,"dataGaLocation":4226},"/services/","services",{"text":4456,"config":4457},"Contribute",{"href":4458,"dataGaName":4459,"dataGaLocation":4226},"https://contributors.gitlab.com","contribute",{"text":4461,"config":4462},"Community",{"href":4463,"dataGaName":4464,"dataGaLocation":4226},"/community/","community",{"text":4466,"config":4467},"Forum",{"href":4468,"dataGaName":4469,"dataGaLocation":4226},"https://forum.gitlab.com/","forum",{"text":4471,"config":4472},"Events",{"href":4473,"dataGaName":4474,"dataGaLocation":4226},"/events/","events",{"text":4476,"config":4477},"Partners",{"href":4478,"dataGaName":4479,"dataGaLocation":4226},"/partners/","partners",{"config":4481,"title":4484,"text":4485,"link":4486},{"background":4482,"textColor":4483},"url('https://res.cloudinary.com/about-gitlab-com/image/upload/v1777322348/qpq8yrgn8knii57omj0c.png')","#000","What’s new in GitLab","Stay updated with our latest features and improvements.",{"text":4487,"config":4488},"Read the latest",{"href":4489,"dataGaName":4490,"dataGaLocation":4226},"/whats-new/","whats new",{"text":4492,"config":4493,"menu":4495},"Company",{"dataNavLevelOne":4494},"company",{"type":4277,"columns":4496},[4497],{"items":4498},[4499,4504,4510,4512,4517,4522,4527,4532,4537,4542],{"text":4500,"config":4501},"About",{"href":4502,"dataGaName":4503,"dataGaLocation":4226},"/company/","about",{"text":4505,"config":4506,"footerGa":4509},"Jobs",{"href":4507,"dataGaName":4508,"dataGaLocation":4226},"/jobs/","jobs",{"dataGaName":4508},{"text":4471,"config":4511},{"href":4473,"dataGaName":4474,"dataGaLocation":4226},{"text":4513,"config":4514},"Leadership",{"href":4515,"dataGaName":4516,"dataGaLocation":4226},"/company/team/e-group/","leadership",{"text":4518,"config":4519},"Handbook",{"href":4520,"dataGaName":4521,"dataGaLocation":4226},"https://handbook.gitlab.com/","handbook",{"text":4523,"config":4524},"Investor relations",{"href":4525,"dataGaName":4526,"dataGaLocation":4226},"https://ir.gitlab.com/overview/default.aspx","investor relations",{"text":4528,"config":4529},"Trust Center",{"href":4530,"dataGaName":4531,"dataGaLocation":4226},"/security/","trust center",{"text":4533,"config":4534},"AI Transparency Center",{"href":4535,"dataGaName":4536,"dataGaLocation":4226},"/ai-transparency-center/","ai transparency center",{"text":4538,"config":4539},"Newsletter",{"href":4540,"dataGaName":4541,"dataGaLocation":4226},"/company/contact/#contact-forms","newsletter",{"text":4543,"config":4544},"Press",{"href":4545,"dataGaName":4546,"dataGaLocation":4226},"/press/","press",{"text":4548,"config":4549,"menu":4550},"Contact us",{"dataNavLevelOne":4494},{"type":4277,"columns":4551},[4552],{"items":4553},[4554,4559,4564],{"text":4555,"config":4556},"Talk to sales",{"href":4557,"dataGaName":4558,"dataGaLocation":4226},"/sales/","talk to sales",{"text":4560,"config":4561},"Support portal",{"href":4562,"dataGaName":4563,"dataGaLocation":4226},"https://support.gitlab.com/hc/en-us","support portal",{"text":4565,"config":4566},"Customer portal",{"href":4567,"dataGaName":4568,"dataGaLocation":4226},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":4570,"login":4571,"suggestions":4578},"Close",{"text":4572,"link":4573},"To search repositories and projects, login to",{"text":4574,"config":4575},"gitlab.com",{"href":4240,"dataGaName":4576,"dataGaLocation":4577},"search login","search",{"text":4579,"default":4580},"Suggestions",[4581,4583,4587,4589,4593,4597],{"text":4257,"config":4582},{"href":4262,"dataGaName":4257,"dataGaLocation":4577},{"text":4584,"config":4585},"Code Suggestions (AI)",{"href":4586,"dataGaName":4584,"dataGaLocation":4577},"/solutions/code-suggestions/",{"text":4293,"config":4588},{"href":4295,"dataGaName":4293,"dataGaLocation":4577},{"text":4590,"config":4591},"GitLab on AWS",{"href":4592,"dataGaName":4590,"dataGaLocation":4577},"/partners/technology-partners/aws/",{"text":4594,"config":4595},"GitLab on Google Cloud",{"href":4596,"dataGaName":4594,"dataGaLocation":4577},"/partners/technology-partners/google-cloud-platform/",{"text":4598,"config":4599},"Why GitLab?",{"href":4270,"dataGaName":4598,"dataGaLocation":4577},{"freeTrial":4601,"mobileIcon":4606,"desktopIcon":4611,"secondaryButton":4614},{"text":4602,"config":4603},"Start free trial",{"href":4604,"dataGaName":4231,"dataGaLocation":4605},"https://gitlab.com/-/trials/new/","nav",{"altText":4607,"config":4608},"Gitlab Icon",{"src":4609,"dataGaName":4610,"dataGaLocation":4605},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":4607,"config":4612},{"src":4613,"dataGaName":4610,"dataGaLocation":4605},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":4615,"config":4616},"Get Started",{"href":4617,"dataGaName":4618,"dataGaLocation":4605},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/get-started/","get started",{"freeTrial":4620,"mobileIcon":4624,"desktopIcon":4626},{"text":4621,"config":4622},"Learn more about GitLab Duo",{"href":4262,"dataGaName":4623,"dataGaLocation":4605},"gitlab duo",{"altText":4607,"config":4625},{"src":4609,"dataGaName":4610,"dataGaLocation":4605},{"altText":4607,"config":4627},{"src":4613,"dataGaName":4610,"dataGaLocation":4605},{"button":4629,"mobileIcon":4634,"desktopIcon":4636},{"text":4630,"config":4631},"/switch",{"href":4632,"dataGaName":4633,"dataGaLocation":4605},"#contact","switch",{"altText":4607,"config":4635},{"src":4609,"dataGaName":4610,"dataGaLocation":4605},{"altText":4607,"config":4637},{"src":4638,"dataGaName":4610,"dataGaLocation":4605},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1773335277/ohhpiuoxoldryzrnhfrh.png",{"freeTrial":4640,"mobileIcon":4645,"desktopIcon":4647},{"text":4641,"config":4642},"Back to pricing",{"href":4375,"dataGaName":4643,"dataGaLocation":4605,"icon":4644},"back to pricing","GoBack",{"altText":4607,"config":4646},{"src":4609,"dataGaName":4610,"dataGaLocation":4605},{"altText":4607,"config":4648},{"src":4613,"dataGaName":4610,"dataGaLocation":4605},{"title":4650,"titleMobile":4651,"button":4652,"config":4657},"Duo Agent Platform delivers 400% ROI, per new Forrester Consulting study.","400% ROI: Forrester TEI for GitLab Duo",{"text":4268,"config":4653},{"href":4654,"dataGaName":4655,"dataGaLocation":4656},"https://about.gitlab.com/blog/gitlab-duo-agent-platform-delivers-400-percent-roi/","forrester-tei-dap-banner","global-banner",{"layout":4658,"disabled":4206},"release",{"data":4660},{"text":4661,"source":4662,"edit":4668,"contribute":4673,"config":4678,"items":4683,"minimal":4893},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"text":4663,"config":4664},"View page source",{"href":4665,"dataGaName":4666,"dataGaLocation":4667},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/","page source","footer",{"text":4669,"config":4670},"Edit this page",{"href":4671,"dataGaName":4672,"dataGaLocation":4667},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/content/","web ide",{"text":4674,"config":4675},"Please contribute",{"href":4676,"dataGaName":4677,"dataGaLocation":4667},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/CONTRIBUTING.md/","please contribute",{"twitter":4679,"facebook":4680,"youtube":4681,"linkedin":4682},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[4684,4731,4785,4829,4861],{"title":4373,"links":4685,"subMenu":4700},[4686,4690,4695],{"text":4687,"config":4688},"View plans",{"href":4375,"dataGaName":4689,"dataGaLocation":4667},"view plans",{"text":4691,"config":4692},"Why Premium?",{"href":4693,"dataGaName":4694,"dataGaLocation":4667},"/pricing/premium/","why premium",{"text":4696,"config":4697},"Why Ultimate?",{"href":4698,"dataGaName":4699,"dataGaLocation":4667},"/pricing/ultimate/","why ultimate",[4701],{"title":4702,"links":4703},"Contact Us",[4704,4707,4709,4711,4716,4721,4726],{"text":4705,"config":4706},"Contact sales",{"href":4557,"dataGaName":4236,"dataGaLocation":4667},{"text":4560,"config":4708},{"href":4562,"dataGaName":4563,"dataGaLocation":4667},{"text":4565,"config":4710},{"href":4567,"dataGaName":4568,"dataGaLocation":4667},{"text":4712,"config":4713},"Status",{"href":4714,"dataGaName":4715,"dataGaLocation":4667},"https://status.gitlab.com/","status",{"text":4717,"config":4718},"Terms of use",{"href":4719,"dataGaName":4720,"dataGaLocation":4667},"/terms/","terms of use",{"text":4722,"config":4723},"Privacy statement",{"href":4724,"dataGaName":4725,"dataGaLocation":4667},"/privacy/","privacy statement",{"text":4727,"config":4728},"Cookie preferences",{"dataGaName":4729,"dataGaLocation":4667,"id":4730,"isOneTrustButton":4209},"cookie preferences","ot-sdk-btn",{"title":4273,"links":4732,"subMenu":4741},[4733,4737],{"text":4734,"config":4735},"DevSecOps platform",{"href":4255,"dataGaName":4736,"dataGaLocation":4667},"devsecops platform",{"text":4738,"config":4739},"AI-Assisted Development",{"href":4262,"dataGaName":4740,"dataGaLocation":4667},"ai-assisted development",[4742],{"title":4743,"links":4744},"Topics",[4745,4750,4755,4760,4765,4770,4775,4780],{"text":4746,"config":4747},"CICD",{"href":4748,"dataGaName":4749,"dataGaLocation":4667},"/topics/ci-cd/","cicd",{"text":4751,"config":4752},"GitOps",{"href":4753,"dataGaName":4754,"dataGaLocation":4667},"/topics/gitops/","gitops",{"text":4756,"config":4757},"DevOps",{"href":4758,"dataGaName":4759,"dataGaLocation":4667},"/topics/devops/","devops",{"text":4761,"config":4762},"Version Control",{"href":4763,"dataGaName":4764,"dataGaLocation":4667},"/topics/version-control/","version control",{"text":4766,"config":4767},"DevSecOps",{"href":4768,"dataGaName":4769,"dataGaLocation":4667},"/topics/devsecops/","devsecops",{"text":4771,"config":4772},"Cloud Native",{"href":4773,"dataGaName":4774,"dataGaLocation":4667},"/topics/cloud-native/","cloud native",{"text":4776,"config":4777},"AI for Coding",{"href":4778,"dataGaName":4779,"dataGaLocation":4667},"/topics/devops/ai-for-coding/","ai for coding",{"text":4781,"config":4782},"Agentic AI",{"href":4783,"dataGaName":4784,"dataGaLocation":4667},"/topics/agentic-ai/","agentic ai",{"title":4786,"links":4787},"Solutions",[4788,4790,4792,4797,4801,4804,4808,4811,4813,4816,4819,4824],{"text":4317,"config":4789},{"href":4312,"dataGaName":4317,"dataGaLocation":4667},{"text":4306,"config":4791},{"href":4289,"dataGaName":4290,"dataGaLocation":4667},{"text":4793,"config":4794},"Agile development",{"href":4795,"dataGaName":4796,"dataGaLocation":4667},"/solutions/agile-delivery/","agile delivery",{"text":4798,"config":4799},"SCM",{"href":4302,"dataGaName":4800,"dataGaLocation":4667},"source code management",{"text":4746,"config":4802},{"href":4295,"dataGaName":4803,"dataGaLocation":4667},"continuous integration & delivery",{"text":4805,"config":4806},"Value stream management",{"href":4345,"dataGaName":4807,"dataGaLocation":4667},"value stream management",{"text":4751,"config":4809},{"href":4810,"dataGaName":4754,"dataGaLocation":4667},"/solutions/gitops/",{"text":4355,"config":4812},{"href":4358,"dataGaName":4359,"dataGaLocation":4667},{"text":4814,"config":4815},"Small business",{"href":4364,"dataGaName":4365,"dataGaLocation":4667},{"text":4817,"config":4818},"Public sector",{"href":4370,"dataGaName":4371,"dataGaLocation":4667},{"text":4820,"config":4821},"Education",{"href":4822,"dataGaName":4823,"dataGaLocation":4667},"/solutions/education/","education",{"text":4825,"config":4826},"Financial services",{"href":4827,"dataGaName":4828,"dataGaLocation":4667},"/solutions/finance/","financial services",{"title":4378,"links":4830},[4831,4833,4835,4837,4840,4842,4845,4847,4849,4851,4853,4855,4857,4859],{"text":4391,"config":4832},{"href":4393,"dataGaName":4394,"dataGaLocation":4667},{"text":4396,"config":4834},{"href":4398,"dataGaName":4399,"dataGaLocation":4667},{"text":4401,"config":4836},{"href":4403,"dataGaName":4404,"dataGaLocation":4667},{"text":4406,"config":4838},{"href":4408,"dataGaName":4839,"dataGaLocation":4667},"docs",{"text":4429,"config":4841},{"href":4431,"dataGaName":4432,"dataGaLocation":4667},{"text":4843,"config":4844},"What's new",{"href":4489,"dataGaName":4490,"dataGaLocation":4667},{"text":4424,"config":4846},{"href":4426,"dataGaName":4427,"dataGaLocation":4667},{"text":4443,"config":4848},{"href":4445,"dataGaName":4446,"dataGaLocation":4667},{"text":4451,"config":4850},{"href":4453,"dataGaName":4454,"dataGaLocation":4667},{"text":4456,"config":4852},{"href":4458,"dataGaName":4459,"dataGaLocation":4667},{"text":4461,"config":4854},{"href":4463,"dataGaName":4464,"dataGaLocation":4667},{"text":4466,"config":4856},{"href":4468,"dataGaName":4469,"dataGaLocation":4667},{"text":4471,"config":4858},{"href":4473,"dataGaName":4474,"dataGaLocation":4667},{"text":4476,"config":4860},{"href":4478,"dataGaName":4479,"dataGaLocation":4667},{"title":4492,"links":4862},[4863,4865,4867,4869,4871,4873,4877,4882,4884,4886,4888],{"text":4500,"config":4864},{"href":4502,"dataGaName":4494,"dataGaLocation":4667},{"text":4505,"config":4866},{"href":4507,"dataGaName":4508,"dataGaLocation":4667},{"text":4513,"config":4868},{"href":4515,"dataGaName":4516,"dataGaLocation":4667},{"text":4518,"config":4870},{"href":4520,"dataGaName":4521,"dataGaLocation":4667},{"text":4523,"config":4872},{"href":4525,"dataGaName":4526,"dataGaLocation":4667},{"text":4874,"config":4875},"Sustainability",{"href":4876,"dataGaName":4874,"dataGaLocation":4667},"/sustainability/",{"text":4878,"config":4879},"Diversity, inclusion and belonging (DIB)",{"href":4880,"dataGaName":4881,"dataGaLocation":4667},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":4528,"config":4883},{"href":4530,"dataGaName":4531,"dataGaLocation":4667},{"text":4538,"config":4885},{"href":4540,"dataGaName":4541,"dataGaLocation":4667},{"text":4543,"config":4887},{"href":4545,"dataGaName":4546,"dataGaLocation":4667},{"text":4889,"config":4890},"Modern Slavery Transparency Statement",{"href":4891,"dataGaName":4892,"dataGaLocation":4667},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"items":4894},[4895,4898,4901],{"text":4896,"config":4897},"Terms",{"href":4719,"dataGaName":4720,"dataGaLocation":4667},{"text":4899,"config":4900},"Cookies",{"dataGaName":4729,"dataGaLocation":4667,"id":4730,"isOneTrustButton":4209},{"text":4902,"config":4903},"Privacy",{"href":4724,"dataGaName":4725,"dataGaLocation":4667},[4905],{"id":4906,"title":7,"body":4205,"config":4907,"content":4909,"description":4205,"extension":4913,"meta":4914,"navigation":4209,"path":4915,"seo":4916,"stem":4917,"__hash__":4918},"blogAuthors/en-us/blog/authors/isaac-dawson.yml",{"template":4908},"BlogAuthor",{"name":7,"config":4910},{"headshot":4911,"ctfId":4912},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749669814/Blog/Author%20Headshots/idawson-headshot.jpg","idawson","yml",{},"/en-us/blog/authors/isaac-dawson",{},"en-us/blog/authors/isaac-dawson","UpCqyNOSlM21joWN2Eu9Z_uC29MGdlJWAYDQImap3w8",[4920,4928,4936],{"title":4921,"description":4922,"heroImage":4923,"category":4201,"date":4924,"authors":4925,"slug":4927,"externalUrl":4205},"How GitLab tracks vulnerabilities through refactors and reformatting","Learn how GitLab's improved Scope+Offset fingerprinting keeps vulnerability tracking stable across comments, blank lines, and reformatting.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1759320418/xjmqcozxzt4frx0hori3.png","2026-08-12",[4926],"Julian Thome","improved-scope-offset-fingerprinting",{"title":4929,"description":4930,"heroImage":4923,"category":4201,"date":4931,"authors":4932,"slug":4935,"externalUrl":4205},"GitLab Secrets Manager adds ESO, Terraform, API support","Simplify credential management across your stack. GitLab Secrets Manager provides secure retrieval in Kubernetes, Terraform, and external workflows.","2026-08-06",[4933,4934],"Erick Bajao","Joe Randazzo","gitlab-secrets-manager-add-eso-terraform-api-support",{"title":4937,"description":4938,"heroImage":4939,"category":4201,"date":4940,"authors":4941,"slug":4943,"externalUrl":4205},"Secure every commit to production with Claude and GitLab","Claude Security catches vulnerabilities inside a coding session. GitLab picks up from there, scanning, enforcing policy, and producing audit evidence for the software lifecycle. ","https://res.cloudinary.com/about-gitlab-com/image/upload/v1756122536/akivvcnafog9c4dhhzkp.png","2026-08-03",[4942],"Alisa Ho","claude-security-and-gitlab",{"promotions":4945},[4946,4960,4972,4983],{"id":4947,"categories":4948,"header":4950,"text":4951,"button":4952,"image":4957},"ai-modernization",[4949],"ai","Is AI achieving its promise at scale?","Quiz will take 5 minutes or less",{"text":4953,"config":4954},"Get your AI maturity score",{"href":4955,"dataGaName":4956,"dataGaLocation":4432},"/assessments/ai-modernization-assessment/","modernization assessment",{"config":4958},{"src":4959},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/qix0m7kwnd8x2fh1zq49.png",{"id":4961,"categories":4962,"header":4964,"text":4951,"button":4965,"image":4969},"devops-modernization",[4963,4769],"product","Are you just managing tools or shipping innovation?",{"text":4966,"config":4967},"Get your DevOps maturity score",{"href":4968,"dataGaName":4956,"dataGaLocation":4432},"/assessments/devops-modernization-assessment/",{"config":4970},{"src":4971},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138785/eg818fmakweyuznttgid.png",{"id":4973,"categories":4974,"header":4975,"text":4951,"button":4976,"image":4980},"security-modernization",[4201],"Are you trading speed for security?",{"text":4977,"config":4978},"Get your security maturity score",{"href":4979,"dataGaName":4956,"dataGaLocation":4432},"/assessments/security-modernization-assessment/",{"config":4981},{"src":4982},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1772138786/p4pbqd9nnjejg5ds6mdk.png",{"id":4984,"paths":4985,"header":4988,"text":4989,"button":4990,"image":4995},"github-azure-migration",[4986,4987],"migration-from-azure-devops-to-gitlab","integrating-azure-devops-scm-and-gitlab","Is your team ready for GitHub's Azure move?","GitHub is already rebuilding around Azure. Find out what it means for you.",{"text":4991,"config":4992},"See how GitLab compares to GitHub",{"href":4993,"dataGaName":4994,"dataGaLocation":4432},"/compare/gitlab-vs-github/github-azure-migration/","github azure migration",{"config":4996},{"src":4971},{"header":4998,"blurb":4999,"button":5000,"secondaryButton":5005},"Start building faster today","See what your team can do with the intelligent orchestration platform for DevSecOps.\n",{"text":5001,"config":5002},"Get your free trial",{"href":5003,"dataGaName":4231,"dataGaLocation":5004},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":4705,"config":5006},{"href":4557,"dataGaName":4236,"dataGaLocation":5004},1786803762144]