+ +```json +{ + "Cross-Site Request Forgery (CSRF)": { + "is_issue": "", + "risk_rating": "Medium", + "jira_priority": "Major", + "grouped": "", + "description": {}, + "recommendation": {}, + "cxsast": "XSRF" + }, + "SQL Injection": { + "is_issue": "", + "risk_rating": "Critical", + "jira_priority": "Major", + "grouped": "", + "description": {}, + "recommendation": {}, + "cxsast": "SQL Injection in Content Provider;SQL_Injection" + }, + "Sensitive Information Disclosure": { + "is_issue": "", + "risk_rating": "High", + "jira_priority": "Major", + "grouped": "", + "description": {}, + "recommendation": {}, + "cxsast": "Sensitive Information Disclosure;Client_Password_In_Comment;Client_Password_Weak_Encryption;CPP_Insecure_Credential_Storage;HardcodedCredentials;Hardcoded_Connection_String;Hardcoded_Password;Hardcoded_password_in_Connection_String;Hardcoded_Password_In_Gradle;Hardcoded_Session_Secret_Token;Hard_Coded_Cryptography_Key;Insufficiently_Protected_Credentials;Kony_Hardcoded_EncryptionKey;Missing_Password_Field_Masking;Password_In_Comment;Password_in_Configuration_File;Password_misuse;Plaintext_Storage_of_a_Password;Storing_Passwords_in_a_Recoverable_Format;Use_of_Hardcoded_Cryptographic_Key;Use_Of_Hardcoded_Password;Use_of_Hardcoded_Password;Use_of_Hard_coded_Cryptographic_Key;Use_of_Hard_coded_Security_Constants" + }, + "Vulnerable Software": { + "is_issue": "", + "risk_rating": "High", + "jira_priority": "Major", + "grouped": "", + "description": {}, + "recommendation": {}, + "cxsast": "Obsolete WordPress version;Client_Use_Of_JQuery_Outdated_Version;Client_JQuery_Deprecated_Symbols;Vulnerable Software Version" + } +} +``` +
++ +#### JSON report + +```json +[ + { + "Issue Name": "Cross-site Scripting (XSS).app/routes/contributions.js", + "Issue Tool": "Checkmarx", + "Steps To Reproduce": "", + "Issue Priority": "Major", + "Issue Severity": "High", + "Issue Confidence": "Certain", + "CWE": "[CWE-79|https://cwe.mitre.org/data/definitions/79]", + "CVE": "", + "Overview": "", + "Recommendations": "# Validate all input, regardless of source. Validation should be based on a whitelist: accept only data fitting a specified structure, rather than reject bad patterns. Check for:\n#* Data type\n#* Size\n#* Range\n#* Format\n#* Expected values\n# Fully encode all dynamic data before embedding it in output.\n# Encoding should be context-sensitive. For example:\n#* HTML encoding for HTML content\n#* HTML Attribute encoding for data output to attribute values\n#* JavaScript encoding for server-generated JavaScript.\n# Consider using either the ESAPI encoding library, or the built-in platform functions. For earlier versions of ASP.NET, consider using the AntiXSS library.\n# In the Content-Type HTTP response header, explicitly define character encoding (charset) for the entire page.\n# Set the httpOnly flag on the session cookie, to prevent XSS exploits from stealing the cookie.\n\n", + "References": "Line 34 in file [app/routes/contributions.js|https://checkmarx.com/CxWebClient/ViewerMain.aspx?scanid=1041725&projectid=3133&pathid=6]", + "Paths": "", + "URLs": "", + "error_string": "Cross-site Scripting (XSS) 79\napp/routes/contributions.js", + "Description": " The software does not sufficiently validate, filter, escape, and/or encode user-controllable input before it is placed in output that is used as a web page that is served to other users.\n GROUP: JavaScript_Server_Side_Vulnerabilities\n CATEGORY: A7-Cross-Site Scripting (XSS)\n *Code*:\n ``` var userId = req.session.userId; ```", + "Instances": "File app/routes/contributions.js", + "Attachments": [], + "Tags": [ + { + "TestType": "sast" + }, + { + "Provider": "Reapsaw" + }, + { + "Tool": "Checkmarx" + } + ], + "Jira Name": "Cross-site Scripting (XSS)", + "Repo": "", + "Links": "https://checkmarx.com/CxWebClient/ViewerMain.aspx?scanid=1041725&projectid=3133&pathid=6", + "Snippet": "var userId = req.session.userId;", + "Jira Description": "h3.*Instances:*\nFile app/routes/contributions.js\nh3.*Recommendations:*\n\n# Validate all input, regardless of source. Validation should be based on a whitelist: accept only data fitting a specified structure, rather than reject bad patterns. Check for:\n#* Data type\n#* Size\n#* Range\n#* Format\n#* Expected values\n# Fully encode all dynamic data before embedding it in output.\n# Encoding should be context-sensitive. For example:\n#* HTML encoding for HTML content\n#* HTML Attribute encoding for data output to attribute values\n#* JavaScript encoding for server-generated JavaScript.\n# Consider using either the ESAPI encoding library, or the built-in platform functions. For earlier versions of ASP.NET, consider using the AntiXSS library.\n# In the Content-Type HTTP response header, explicitly define character encoding (charset) for the entire page.\n# Set the httpOnly flag on the session cookie, to prevent XSS exploits from stealing the cookie.\n\n\nh3.*Overview:*\n{panel:title=Cross-site Scripting (XSS)}*Description*: \nThe software does not sufficiently validate, filter, escape, and/or encode user-controllable input before it is placed in output that is used as a web page that is served to other users.\n GROUP: JavaScript_Server_Side_Vulnerabilities\n CATEGORY: A7-Cross-Site Scripting (XSS)\n *Code*:\n ``` var userId = req.session.userId; ```\n\n*References*: \nLine 10 in file [app/routes/contributions.js|https://checkmarx.com/CxWebClient/ViewerMain.aspx?scanid=1041725&projectid=3133&pathid=5]\n\n{panel}\n{panel:title=Cross-site Scripting (XSS)}*Description*: \nThe software does not sufficiently validate, filter, escape, and/or encode user-controllable input before it is placed in output that is used as a web page that is served to other users.\n GROUP: JavaScript_Server_Side_Vulnerabilities\n CATEGORY: A7-Cross-Site Scripting (XSS)\n *Code*:\n ``` var userId = req.session.userId; ```\n\n*References*: \nLine 34 in file [app/routes/contributions.js|https://checkmarx.com/CxWebClient/ViewerMain.aspx?scanid=1041725&projectid=3133&pathid=6]\n\n{panel}\n" + }, + { + "Issue Name": "Regular Expression Denial of Service (ReDoS).marked", + "Issue Tool": "Snyk", + "Steps To Reproduce": "", + "Issue Priority": "Major", + "Issue Severity": "High", + "Issue Confidence": "Certain", + "CWE": "CWE-185", + "CVE": "", + "Overview": "", + "Recommendations": "Upgrade `marked` to version 0.6.2 or higher", + "References": "\r\n- [GitHub PR](https://github.com/markedjs/marked/pull/1083)\r\n- [GitHub Commit](https://github.com/markedjs/marked/pull/1083)", + "Paths": "owasp-nodejs-goat>marked@0.3.9", + "URLs": "", + "error_string": "marked", + "Description": "*Vulnerable Package:* marked\n*Current Version:* 0.3.9\n*Vulnerable Version(s):* <0.3.18\n \n *Remediation:*\r\nUpgrade marked to version 0.3.17 or higher\r\n\r\n\n Overview\r\n[`marked`](https://www.npmjs.com/package/marked) is a markdown parser built for speed\r\n\r\nAffected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. This can cause an impact of about 10 seconds matching time for data 150 characters long.\r\n\r\n\n ", + "Instances": "marked", + "Attachments": [], + "Tags": [ + { + "TestType": "sast" + }, + { + "Provider": "Reapsaw" + }, + { + "Tool": "Snyk" + } + ], + "Jira Name": "Vulnerable Software", + "Repo": "", + "top_level_module": "marked", + "upgrades": [ + false, + "marked@0.3.18" + ], + "language": "js", + "RP Defect Type": "Product Bug" + } +] +``` +
+
+
+
+```xml
+
+ +#### HTML report +![HTML](https://github.com/dowjones/sast/blob/develop/docs/html_report.png) +
++ +
++ +```js +[{ + "Issue Name": "Regular Expression Denial of Service (ReDoS).marked", + "Issue Tool": "Snyk", + "Steps To Reproduce": "", + "Issue Priority": "Major", + "Issue Severity": "High", + "Issue Confidence": "Certain", + "CWE": "CWE-185", + "CVE": "", + "Overview": "", + "Recommendations": "Upgrade `marked` to version 0.6.2 or higher", + "References": "\r\n- [GitHub PR](https://github.com/markedjs/marked/pull/1083)\r\n- [GitHub Commit](https://github.com/markedjs/marked/pull/1083)", + "Paths": "owasp-nodejs-goat>marked@0.3.9", + "URLs": "", + "error_string": "marked", + "Description": "*Vulnerable Package:* marked\n*Current Version:* 0.3.9\n*Vulnerable Version(s):* <0.3.18\n \n *Remediation:*\r\nUpgrade marked to version 0.3.17 or higher\r\n\r\n\n Overview\r\n[`marked`](https://www.npmjs.com/package/marked) is a markdown parser built for speed\r\n\r\nAffected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. This can cause an impact of about 10 seconds matching time for data 150 characters long.\r\n\r\n\n ", + "Instances": "marked", + "Attachments": [], + "Tags": [ + { + "TestType": "sast" + }, + { + "Provider": "Reapsaw" + }, + { + "Tool": "Snyk" + } + ], + "Jira Name": "Vulnerable Software", + "Repo": "", + "top_level_module": "marked", + "upgrades": [ + false, + "marked@0.3.18" + ], + "language": "js", + "RP Defect Type": "Product Bug" + }] +``` +
+ public IActionResult PostTranslateDjml([FromBody] JsonApiResponse<ArticleData, MetaArticle> article, [FromServices] IContentTranslation contentTranslation)
+ var xml = contentTranslation.ArticleToDjml(article);
+ public async Task<IActionResult> GetDjmlByOriginId(string id, [FromHeader(Name= "x-api-key")] string apiKey)
+ var article = await _articleGateway.GetDjmlByExternalIdAsync(id);
+ + |
+ Failure to Preserve Web Page Structure ('Cross-site Scripting')
+
+ |
+ + | + +
Weakness ID: 79 (Weakness Base) | ++ | Status: Usable | +
+ Client_DOM_Stored_XSS
++ Risk
++ What might happen
+++An attacker could use legitimate access to the application to submit engineered data to the application’s database. When another user subsequently accesses this data, web pages may be rewritten and malicious scripts may be activated.+
+ Cause
++ How does it happen
+++The application creates web pages that include data from the application’s database. The data is embedded directly in the page's HTML, causing the browser to display it as part of the web page. This data may have originated in input from another user. If the data includes HTML fragments or Javascript, these are displayed too, and the user cannot tell that this is not the intended page. The vulnerability is the result of embedding arbitrary database data without first encoding it in a format that would prevent the browser from treating it like HTML instead of plain text.+
+ General Recommendations
++ How to avoid it
++++
+- Validate all dynamic data, regardless of source. Validation should be based on a whitelist: accept only data fitting a specified structure, rather than reject bad patterns. Check for:
++
+- Data type
+- Size
+- Range
+- Format
+- Expected values
+- Validation is not a replacement for encoding. Fully encode all dynamic data, regardless of source, before embedding it in output. Encoding should be context-sensitive. For example:
++
+- HTML encoding for HTML content
+- HTML attribute encoding for data output to attribute values
+- Javascript encoding for server-generated Javascript.
+- Consider using either the ESAPI encoding library, or its built-in functions. For earlier versions of ASP.NET, consider using the AntiXSS library.
+- In the Content-Type HTTP response header, explicitly define character encoding (charset) for the entire page.
+- Set the httpOnly flag on the session cookie, to prevent XSS exploits from stealing the cookie.
+
+ Source Code Examples
++ CSharp
++ Data obtained from the execution of an SQL command is output to a label