This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "OWASP Serverless Goat"
m (→Project Sponsors) (Tag: Visual edit) |
(Final edits for publish) (Tag: Visual edit) |
||
Line 22: | Line 22: | ||
The application is a service which receives a URL to a Word document (with a .doc extension - Office 97-2004), and will reply with an HTML page containing the extracted text. | The application is a service which receives a URL to a Word document (with a .doc extension - Office 97-2004), and will reply with an HTML page containing the extracted text. | ||
− | + | The vulnerabilities that are included are: | |
* Event-data injection, leading to OS command injection (SAS-01) | * Event-data injection, leading to OS command injection (SAS-01) | ||
* Improper exception handling and verbose error messages (SAS-10), leading to sensitive information disclosure | * Improper exception handling and verbose error messages (SAS-10), leading to sensitive information disclosure | ||
Line 35: | Line 35: | ||
The OWASP ServerlessGoat project is free for use. You can redistribute it and/or modify it under the terms of the [http://www.gnu.org/licenses/agpl-3.0.html link GNU Affero General Public License 3.0] as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | The OWASP ServerlessGoat project is free for use. You can redistribute it and/or modify it under the terms of the [http://www.gnu.org/licenses/agpl-3.0.html link GNU Affero General Public License 3.0] as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | ||
+ | |||
+ | == Deployment == | ||
+ | |||
+ | ServerlessGoat is a simple AWS Lambda application, which serves as a MS-Word .doc file to plain text converter service. It receives a URL to a .doc file as input, and will return the text inside the document back to the API caller. The application is packaged and published for deployment through the [https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:761130837472:applications~serverless-goat AWS Serverless Application Repository]. Steps for deployment: | ||
+ | # Make sure you are logged into your AWS account | ||
+ | # Click on the following link: AWS Serverless Application Repository | ||
+ | # Click 'Deploy' | ||
+ | # Click 'Deploy' (again) | ||
+ | # Wait until you see the message 'Your application has been deployed' | ||
+ | # Click on 'View CloudFormation Stack' | ||
+ | # Under 'Outputs' you will find the URL for the application (WebsiteURL) | ||
== Roadmap == | == Roadmap == | ||
Line 45: | Line 56: | ||
[[File:PureSec-Logo.png|frameless|link=https://www.puresec.io/]] | [[File:PureSec-Logo.png|frameless|link=https://www.puresec.io/]] | ||
+ | |||
+ | == Cheat Sheet == | ||
+ | |||
+ | The following security issues exist in the application: | ||
+ | * Event-data injection, leading to OS command injection (SAS-01) | ||
+ | * Users can invoke the API with a <code>document_url</code> parameter value containing Linux OS commands. E.g. <code>; ls -LF</code> | ||
+ | * Improper exception handling and verbose error messages (SAS-10), leading to sensitive information disclosure | ||
+ | * For example, invoking the API without the required parameter will return a verbose stack trace/exception | ||
+ | * Insecure Serverless Deployment Configuration (SAS-03) | ||
+ | * Publicly open S3 bucket (its name can be discovered from the subdomain/prefix of the URL) | ||
+ | * The parameter <code>document_url</code> is not defined as a 'required' parameter in API gateway and can be ommitted | ||
+ | * Over-privileged function permissions & roles, leading to data leakage of information stored in a DynamoDB table (SAS-04) | ||
+ | * The function has CRUD permissions on the Dynamo table, which can be abused for reading sensitive data, or manipulating data | ||
+ | * The function has FullAccess policy on the S3 bucket, leading to data tampering and data leakage, etc. | ||
+ | * Inadequate function monitoring and logging (SAS-05) - the application doesn't properly log application layer attacks and errors (can be demonstrated thro\ugh CloudWatch/CloudTrail) | ||
+ | * Insecure 3rd Party Dependencies (SAS-06) - can be detected by scanning the project with an OSS scanning tool | ||
+ | * The vulnerable package is <code>node-uuid</code> | ||
+ | * Application layer Denial of Service (SAS-08), which can be easily demonstrated | ||
+ | * An attacker may invoke the API recursively multiple times, essentially spawning enough instances to reach the function's reserved capacity limit (which is set to 5). For example: <code><nowiki>https://i92uw6vw73.execute-api.us-east-1.amazonaws.com/Prod/api/convert?document_url=https%3A%2F%2Fi92uw6vw73.execute-api.us-east-1.amazonaws.com%2FProd%2Fapi%2Fconvert%3Fdocument_url%3Dhttps%253A%252F%252Fi92uw6vw73.execute-api.us-east-1.amazonaws.com%252FProd%252Fapi%252Fconvert%253Fdocument_url%253Dhttps%25253A%25252F%25252Fi92uw6vw73.execute-api.us-east-1.amazonaws.com%25252FProd%25252Fapi%25252Fconvert%25253Fdocument_url%25253Dhttps%2525253A%2525252F%2525252Fi92uw6vw73.execute-api.us-east-1.amazonaws.com%2525252FProd%2525252Fapi%2525252Fconvert%2525253Fdocument_url%2525253Dhttp%252525253A%252525252F%252525252Fwww.snee.com%252525252Fxml%252525252Fxslt%252525252Fsample.doc</nowiki></code>. | ||
+ | * An undisclosed ''critical'' issue, as a bonus! | ||
+ | |||
==Getting Involved== | ==Getting Involved== | ||
You do not have to be a security expert or a programmer to contribute. Contact the Project Leader(s) to get involved, we welcome any type of suggestions and comments. | You do not have to be a security expert or a programmer to contribute. Contact the Project Leader(s) to get involved, we welcome any type of suggestions and comments. | ||
Line 51: | Line 83: | ||
== Project Resources == | == Project Resources == | ||
− | + | Deployment via the [https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:761130837472:applications~serverless-goat AWS Serverless App Repository] | |
== Project Leader == | == Project Leader == |
Revision as of 13:14, 18 December 2018
IntroductionOWASP ServerlessGoat is a deliberately insecure realistic AWS Lambda serverless application, maintained by OWASP. You can install WebGoat, learn about the vulnerabilities, how to exploit them, and how to remediate each issue. The project also includes documentation explaining the issues and how they should be remediated with best-practices. As serverless adoption is expected to continue growing and reach new audiences, we see the importance of education on topics such as how to build robust, secure and reliable AWS Lambda serverless applications. This project will expose developers and security practitioners to basic serverless security concepts, risks, attacks and mitigation best-practices. There were a few key principles that we wanted to follow when designing this demo vulnerable application:
Given these key principles, we chose to develop and package the application an AWS SAM application that's available for deployment through the AWS Serverless Application Repository - however, this meant that we had to use the supported SAM policy templates. While this decision imposes some limitations on what capabilities were available for us, it presented two important benefits:
DetailsThe application is a service which receives a URL to a Word document (with a .doc extension - Office 97-2004), and will reply with an HTML page containing the extracted text. The vulnerabilities that are included are:
LicensingThe OWASP ServerlessGoat project is free for use. You can redistribute it and/or modify it under the terms of the link GNU Affero General Public License 3.0 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. DeploymentServerlessGoat is a simple AWS Lambda application, which serves as a MS-Word .doc file to plain text converter service. It receives a URL to a .doc file as input, and will return the text inside the document back to the API caller. The application is packaged and published for deployment through the AWS Serverless Application Repository. Steps for deployment:
Roadmap
Project SponsorsThe project was initially developed by PureSec: Cheat SheetThe following security issues exist in the application:
Getting InvolvedYou do not have to be a security expert or a programmer to contribute. Contact the Project Leader(s) to get involved, we welcome any type of suggestions and comments. |
Project ResourcesDeployment via the AWS Serverless App Repository Project LeaderProject Mailing ListTBD Github RepoClassifications |