securing your app - a hacker's perspective · securing your app: a hacker's perspective...

35
MENDIX WORLD Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The S-Unit

Upload: others

Post on 20-May-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Securing Your App:A Hacker's PerspectiveJan de Vries / Community Engagement Manager/ MendixDirk van Veen / Security Consultant / The S-Unit

Page 2: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

1 2 3Security in Mendix: Roles and access controls

How a hacker sees Mendix UI vs. API

Bypassing the UI: Manually and through JS API

Agenda

4 5 6Exercise:

Read access

Exercise:

Write access

Exercise:

Microflow access

Page 3: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

$1.5 trillion

Page 4: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Security in a Mendix App

Cross-site scripting

SQL injection

Code execution

Page 5: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Security in Mendix

Roles and access controls

Page 6: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

“If you want full security, you need to explicitly give access to forms, entities and microflows before someone can access them.”

Mendix Documentation

Page 7: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 8: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 9: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 10: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 11: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

How a hacker sees Mendix

UI vs. API

Page 12: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 13: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 14: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 15: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 16: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Bypassing the UI

Manually and through JS API

Page 17: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 18: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

/XAS/ API

Backend JSON endpoint for Mendix apps

Used for all data retrieval and modification

• Basic CRUD operations• Search or filter functionality• Calling Microflows • Authentication• Get Model metadata

Undocumented

Page 19: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 20: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 21: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Client API

JavaScript framework for Mendix apps

Abstraction layer on top of /xas/

Support most /xas/ functionalities

• Basic CRUD operations• Search or filter functionality• Calling Microflows • Etc.

Documented!

Page 22: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 23: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

• Readable sensitive entities• Readable sensitive attributes

• Missing XPath constraints on access rules

ExerciseInsecure Read Access

Page 24: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 25: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Go Do It

Go to:

[url]

Do the following:

1. Click on Exercise 1

2. Open developer console3. Use mx.data.get to find the hidden

ModuleRead.Secret objects.

Time: 3m

Page 26: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

• Writeable sensitive attributes• Missing XPath constraints on access rules

ExerciseInsecure Write Access

Page 27: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 28: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 29: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Go Do It

Go to:

[url]

Do the following:

1. Click on Exercise 2

2. Use mx.data.get to retrieve your ModuelWrite.User object

3. Use MxObject.set and mx.data.commit to change your name to Admin

4. Find the ModuleWrite.Secret objects

Time: 3m

Page 30: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

ExerciseInsecure Microflow Access• Accessible sensitive microflows• Accessible insecure microflows

Page 31: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Page 32: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Go Do It

Go to:

[url]

Do the following:

1. Click on Exercise 3

2. Use mx.data.get to find the hidden ModuleFlow.Secret

3. Use mx.data.action to call microflow ModuleFlow.ShowSecret with the hidden object and retrieve its secret

Time: 3m

Page 33: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

The S-Unit & Mendix Apps

Mendix Quick Scan

Inventory your publicly exposed Mendix objects

and scan them for sensitive information

Mendix Penetration Test

Black/grey box penetration test of your Mendix app

without prior knowledge of your Mendix model

Mendix Model Review

Whitebox review of your Mendix model including

roles, access controls, flows, Java actions, and more

www.the-s-unit.nl

Page 34: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Upgrade Your Security Knowledge

Mendix Evaluation Guide

Detailed explanation of platform, runtime and

cloud security, including our security model

Mendix Online Academy

Choose from a range of learning paths to learn everything you need to

know about app security

Mendix Blog

Read about the latest trends in security, app

development and Mendix releases in the Mendix blog

www.mendix.com/evaluation-guide Learn.mendix.com www.mendix.com/blogs

Page 35: Securing Your App - A Hacker's Perspective · Securing Your App: A Hacker's Perspective Jan de Vries / Community Engagement Manager/ Mendix Dirk van Veen / Security Consultant / The

MENDIXWORLD

Questions