📙
AppSec
  • Overview
  • Write Ups Compilations/Resources
  • Main Resources
  • Labs
  • Cross Site Request Forgery
    • Cross Site Request Forgery (CSRF)
      • Write-ups
      • Source Code Examples
      • Labs
  • Missing Access Controls
    • Missing Access Controls
      • Write-ups
      • Source Code Examples
      • Resources
      • Testing Tips
  • LFI / Directory Traversal
    • Local File Inclusion
      • Local File Inclusion Writeups
      • Source Code Examples
      • Labs
  • XXE
    • XML External Entity (XXE)
      • Write-ups
      • Source Code Examples
      • Labs
      • More Writeups
      • Payloads
      • Resources
  • Injection
    • Command Injection
      • Writeups
    • Server-Side Template Injection
      • Server-Side Template Injection Writeups
      • More Write-ups
      • Source Code Examples
      • Labs
      • Resources
      • Payloads
      • Tools
    • SQL Injection
      • SQLI Write-ups
      • Source Code Examples
      • More Write-ups
      • Labs
      • Resources & Tools
  • SSRF
    • Server-Side Request Forgery (SSRF)
      • SSRF Write-ups
      • Source Code Review
  • Unvalidated Redirects and Forwards
    • Unvalidated Redirects and Forwards
      • Writeups
      • Source Code Examples
  • Verbose Error Messages and Stack Traces
    • Verbose Error Messages and Stack Traces
      • Write-ups
Powered by GitBook
On this page
  • Uber - Template Injection Python RCE
  • WordPress - XSS
  • Unikrn - Smarty Template

Was this helpful?

  1. Injection
  2. Server-Side Template Injection

Server-Side Template Injection Writeups

PreviousServer-Side Template InjectionNextMore Write-ups

Last updated 4 years ago

Was this helpful?

Uber - Template Injection Python RCE

Personal Blog Post:

Orange Tsai discovered a Template Injection on rider.uber.com domain. Changing user name to the payload {{ '7'*7 }} will return the value '7777777'in the followup email "Your Uber account information has been updated" notification.

//Payloads used 
{{ '7'*7 }}
{{ [].class.base.subclasses() }} # get all classes
{{''.class.mro()[1].subclasses()}}
{%for c in [1,2,3] %}{{c,c,c}}{% endfor %}

WordPress - XSS

The billing_first_name body parameter on the POST /wp-admin/admin-ajax.php route is vulnerable to Template Injection which allows Stored XSS on the account page.

The Stored XSS is returned on the accounts page https://mercantile.wordpress.org/my_account:

Unikrn - Smarty Template

Researcher discovered on of the fields on the user invite page was vulnerable to Template Injection. Upon entering {7*7} into all the fields for registration a verbose error message is returned in the email message notification, revealing a Smarty Template engine message.

Further exploited using a php payload to extract the /etc/passwd file:

{php}$s = file_get_contents('/etc/passwd',NULL, NULL, 0, 100); var_dump($s);{/php}

Uber disclosed on HackerOne: uber.com may RCE by Flask Jinja2...HackerOne
Logo
Uber 遠端代碼執行- Uber.com Remote Code Execution via Flask Jinja2 Template InjectionOrange
WordPress disclosed on HackerOne: Stored xss via template injectionHackerOne
Logo
Unikrn disclosed on HackerOne: Urgent: Server side template...HackerOne
Email notification with the executed template injection payload showing execution on the backend server
HTTP POST request with Template Injection payload in the billing_first_name body parameter
Stored XSS Alert payload executed on the account page
Email response for user invite with {7*7} entered as payload
Contents of /etc/passwd file returned in noreply email
Logo