Research Report: Mitigating LangSec Problems With Capabilities Or: - - PowerPoint PPT Presentation

research report mitigating langsec problems with
SMART_READER_LITE
LIVE PREVIEW

Research Report: Mitigating LangSec Problems With Capabilities Or: - - PowerPoint PPT Presentation

Tradition Sandstorm 95% of CVEs? Research Report: Mitigating LangSec Problems With Capabilities Or: How Sandstorm Taught Me to Stop Worrying and Love the Web Nathaniel Wesley Filardo May 26, 2016 1 / 14 Tradition Sandstorm 95% of CVEs?


slide-1
SLIDE 1

Tradition Sandstorm 95% of CVEs?

Research Report: Mitigating LangSec Problems With Capabilities Or: How Sandstorm Taught Me to Stop Worrying and Love the Web

Nathaniel Wesley Filardo May 26, 2016

1 / 14

slide-2
SLIDE 2

Tradition Sandstorm 95% of CVEs?

One-Slide Elevator Pitch Actually two, related, pitches:

❼ Sandstorm’s capability-based design enables very

fine-grained sandboxing of application software, which largely (sometimes completely!) mitigates the majority of LangSec bugs seen in practice.

❼ Capability systems offer the potential to turn difficult

authorization decisions into LangSec’s bread and butter: syntactic constraints on requests; every well-formed request which can be stated is authorized.

2 / 14

slide-3
SLIDE 3

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Sad Story Consider a standard LAMP-esque stack.

❼ Many co-hosted applications at different paths.

❼ Maybe have separate kernel UIDs when executing?

❼ ❼

3 / 14

slide-4
SLIDE 4

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Sad Story Consider a standard LAMP-esque stack.

❼ Many co-hosted applications at different paths.

❼ Maybe have separate kernel UIDs when executing?

❼ System design encourages ambient authority:

❼ esp. to filesystem, network resources.

❼ ❼

3 / 14

slide-5
SLIDE 5

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Sad Story Consider a standard LAMP-esque stack.

❼ Many co-hosted applications at different paths.

❼ Maybe have separate kernel UIDs when executing?

❼ System design encourages ambient authority:

❼ esp. to filesystem, network resources.

❼ Database processes per-server

❼ Own notion of users (typ. “app”) and permissions.

❼ ❼

3 / 14

slide-6
SLIDE 6

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Sad Story Consider a standard LAMP-esque stack.

❼ Many co-hosted applications at different paths.

❼ Maybe have separate kernel UIDs when executing?

❼ System design encourages ambient authority:

❼ esp. to filesystem, network resources.

❼ Database processes per-server

❼ Own notion of users (typ. “app”) and permissions.

❼ Client authn, authz up to each hosted application.

❼ Even SSO systems typically require application buy-in. ❼ Groups, ACLs, etc. per application.

3 / 14

slide-7
SLIDE 7

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Sad Story Consider a standard LAMP-esque stack.

❼ Many co-hosted applications at different paths.

❼ Maybe have separate kernel UIDs when executing?

❼ System design encourages ambient authority:

❼ esp. to filesystem, network resources.

❼ Database processes per-server

❼ Own notion of users (typ. “app”) and permissions.

❼ Client authn, authz up to each hosted application.

❼ Even SSO systems typically require application buy-in. ❼ Groups, ACLs, etc. per application.

❼ Web’s failings left to apps: XSRF, XSS, SRI, . . .

3 / 14

slide-8
SLIDE 8

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Impact of LangSec Bugs In this environment, what do LangSec bugs buy an attacker?

❼ Outright authn/authz confusion:

❼ Authn/authz cookie leak & replay ❼ XSRF & XSS

❼ ❼ ❼

❼ ❼ ❼

4 / 14

slide-9
SLIDE 9

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Impact of LangSec Bugs In this environment, what do LangSec bugs buy an attacker?

❼ Outright authn/authz confusion:

❼ Authn/authz cookie leak & replay ❼ XSRF & XSS

❼ Path traversals:

❼ Access to intra-application resources (almost surely) ❼ Access to other applications’ resources (maybe) ❼ Access to system configuration (likely)

❼ ❼ ❼

4 / 14

slide-10
SLIDE 10

Tradition Sandstorm 95% of CVEs?

Traditional Web Application Hosting The Impact of LangSec Bugs In this environment, what do LangSec bugs buy an attacker?

❼ Outright authn/authz confusion:

❼ Authn/authz cookie leak & replay ❼ XSRF & XSS

❼ Path traversals:

❼ Access to intra-application resources (almost surely) ❼ Access to other applications’ resources (maybe) ❼ Access to system configuration (likely)

❼ Code injection:

❼ Probe file system, loopback network ❼ Make remote network connections ❼ Probe local kernel for vulnerabilities

Too easy for bug in one application to impact entire server.

4 / 14

slide-11
SLIDE 11

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Sweeping changes to design of system:

❼ Replace web server with application supervisor.

❼ Not “Web Application Firewall” ❼ No dynamic inspection of application display content!

❼ ❼

❼ ❼ ❼

5 / 14

slide-12
SLIDE 12

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Sweeping changes to design of system:

❼ Replace web server with application supervisor.

❼ Not “Web Application Firewall” ❼ No dynamic inspection of application display content!

❼ Centralize authn to supervisor.

❼ Send user display information to application.

❼ ❼

❼ ❼ ❼

5 / 14

slide-13
SLIDE 13

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Sweeping changes to design of system:

❼ Replace web server with application supervisor.

❼ Not “Web Application Firewall” ❼ No dynamic inspection of application display content!

❼ Centralize authn to supervisor.

❼ Send user display information to application.

❼ Centralize authz to supervisor (mostly).

❼ Applications enumerate possible “rights”. ❼ Supervisor computes agent’s rights; tells application.

❼ ❼ ❼

5 / 14

slide-14
SLIDE 14

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Sweeping changes to design of system:

❼ Replace web server with application supervisor.

❼ Not “Web Application Firewall” ❼ No dynamic inspection of application display content!

❼ Centralize authn to supervisor.

❼ Send user display information to application.

❼ Centralize authz to supervisor (mostly).

❼ Applications enumerate possible “rights”. ❼ Supervisor computes agent’s rights; tells application.

❼ Sandbox server-side resources very tightly.

❼ Each document in its own container is possible! ❼ Granularity up to application author and user. ❼ Possible due to centralized management of sharing.

5 / 14

slide-15
SLIDE 15

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Old world:

❼ As admin, install application to web server (or find host) ❼ Users register with each application (or be anonymous) ❼ Application juggles many documents / objects / . . . ❼ User rights managed within each application ❼ ❼ ❼ ❼

❼ ❼

6 / 14

slide-16
SLIDE 16

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting What a mess! Alternative design? Old world:

❼ As admin, install application to web server (or find host) ❼ Users register with each application (or be anonymous) ❼ Application juggles many documents / objects / . . . ❼ User rights managed within each application

New world:

❼ As admin, install sandstorm server (or . . . ) ❼ Users register once with sandstorm installation (or . . . ) ❼ Users install arbitrary applications as desired! ❼ Users instantiate applications as “grains.”

❼ Each user may have zero or more grains of any app. ❼ Grains begin private to creator.

❼ Users share (and revoke) appropriate access to grains.

6 / 14

slide-17
SLIDE 17

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting User’s Perspective

7 / 14

slide-18
SLIDE 18

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting User’s Perspective

7 / 14

slide-19
SLIDE 19

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting User’s Perspective https://main.sandstorm.acm.jhu.edu/shared/ pruMzgByO3ReRVV9tT5uQQyhwXJulmoMCSNSFutPjXJ

7 / 14

slide-20
SLIDE 20

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Supervisor’s Perspective Supervisor tracks capabilities conveying rights to grains:

❼ Each application specifies a collection of rights.

❼ ShareLaTeX: “read”, “write” ❼ DokuWiki: “user”, “manager”, “admin” ❼ When grain is created, owner gets all rights. ❼ Nobody else gets any rights

❼ ❼ ❼

8 / 14

slide-21
SLIDE 21

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Supervisor’s Perspective Supervisor tracks capabilities conveying rights to grains:

❼ Each application specifies a collection of rights.

❼ ShareLaTeX: “read”, “write” ❼ DokuWiki: “user”, “manager”, “admin” ❼ When grain is created, owner gets all rights. ❼ Nobody else gets any rights

❼ Users delegate access to grains:

❼ Creates a new capability object held by designated

user(s) or within a sharing link.

❼ Delegated access is a subset of delegator’s access. ❼ Sandstorm tracks provenance of rights & adjusts.

8 / 14

slide-22
SLIDE 22

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Supervisor’s Perspective Supervisor juggles sessions: user’s live connection to a grain.

❼ Grains started and stopped by supervisor as needed. ❼

9 / 14

slide-23
SLIDE 23

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Supervisor’s Perspective Supervisor juggles sessions: user’s live connection to a grain.

❼ Grains started and stopped by supervisor as needed. ❼ At session startup, the grain is told what rights the

initiator has to the grain.

❼ Each request by a user will be part of a session.

Application just needs to check that request is permitted by session’s rights. ❼

9 / 14

slide-24
SLIDE 24

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Supervisor’s Perspective Supervisor juggles sessions: user’s live connection to a grain.

❼ Grains started and stopped by supervisor as needed. ❼ At session startup, the grain is told what rights the

initiator has to the grain.

❼ Each request by a user will be part of a session.

Application just needs to check that request is permitted by session’s rights. ❼ Web sessions on random hostnames (anti-XSRF, -XSS).

❼ Not as good as if application didn’t have bugs, but ups

ante to require that attacker can see client traffic.

9 / 14

slide-25
SLIDE 25

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Application’s Perspective Grain subject to extremely fine sandboxing:

❼ Filesystem (private mount namespace) contains only:

❼ grain’s application mounted read-only ❼ grain’s data mounted read-write ❼ Minimal collection of “device” nodes

❼ Native network access limited to “dummy” interface. ❼ Many syscalls are disabled via seccomp-bpf.

10 / 14

slide-26
SLIDE 26

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Application’s Perspective Grain software is born (exec()’d) with a socket to the

  • supervisor. All communication flows over this socket.

❼ Outbound network requests overseen by supervisor! ❼ Inbound requests, naturally, too. ❼

11 / 14

slide-27
SLIDE 27

Tradition Sandstorm 95% of CVEs?

Sandstorm Application Hosting Application’s Perspective Grain software is born (exec()’d) with a socket to the

  • supervisor. All communication flows over this socket.

❼ Outbound network requests overseen by supervisor! ❼ Inbound requests, naturally, too. ❼ Uses “Cap’n Proto” capability-based RPC.

11 / 14

slide-28
SLIDE 28

Tradition Sandstorm 95% of CVEs?

95% of CVEs? Sandstorm project claims 95% of (application) security issues automatically mitigated, before they were discovered. That is borne out by the data:

❼ 20 CVEs in sampled applications (some restrictions apply)

❼ Only one, an XSS exploit, was not fully mitigated. ❼ All path traversal bugs (4) mooted. ❼ Most code injection bugs (2 of 3) required write access

to the grain to execute; 3rd in typically unshared grains.

❼ Authn (3) & authz (2) bugs eliminated: supervisor’s job!

❼ Additionally: 27 (of 224) Linux kernel CVEs considered;

  • nly 3 pose threat to Sandstorm hosts.

12 / 14

slide-29
SLIDE 29

Tradition Sandstorm 95% of CVEs?

95% of CVEs? However, capabilities and sandboxing are not a panacea!

❼ Still possible to have bad authz checks in applications. ❼ May be difficult to draw sandbox boundaries neatly in all

cases; authz, path traversal, and/or code injection bugs here could still lead to unintentional information disclosure.

13 / 14

slide-30
SLIDE 30

Tradition Sandstorm 95% of CVEs?

The hope is that this approach...

❼ rules out or confines damage from certain classes of bugs ❼ makes it easier to write secure multi-user applications ❼ Provides new slogan and grounds for LangSec:

“Every well-formed request is authorized” means that parsers become the place for authn checks.

14 / 14

slide-31
SLIDE 31

Tradition Sandstorm 95% of CVEs?

The hope is that this approach...

❼ rules out or confines damage from certain classes of bugs ❼ makes it easier to write secure multi-user applications ❼ Provides new slogan and grounds for LangSec:

“Every well-formed request is authorized” means that parsers become the place for authn checks.

Questions?

14 / 14