All hands-on labs

Premium Hands-on labintermediatered teamAWS

Access environment variables via Lambda Function with SSTI

Learn how to exploit a Server-Side Template Injection (SSTI) vulnerability in an AWS Lambda-based web application. In this lab, you'll discover default credentials in a startup's web portal with a template-based audit report system, then craft SSTI payloads to execute system commands and access sensitive Lambda environment variables. Through hands-on practice, you'll understand both the attack methodology and learn essential mitigation strategies for securing serverless applications.

  • 8 guided tasks
  • Capture the flag

Scenario

As a security researcher, you've been hired by a startup company to find potential security vulnerabilities after their recent round of funding. During your research, you discovered a portal that appears to be a serverless application running on AWS Lambda via a public URL.

Initial reconnaissance reveals a simple login page, but what catches your attention is that the application's home page advertises a feature allowing users to generate custom audit reports using templates. Your experience tells you that template-based report generation can often be a source of security vulnerabilities if not implemented carefully.

Your starting point is the login page.

What you will learn

  • Open a public report portal served by an AWS Lambda function
  • Sign in with the default credentials left in the application
  • Test the remarks field for SQL injection, command injection, and template injection
  • Confirm a server-side template injection flaw with a Jinja2 expression
  • Read the Lambda environment variables through the flaw and capture the flag
Hands-on lab

Access environment variables via Lambda Function with SSTI

Included in Cybr Premium.