Lune

S&P2017Top-tier venue

Hardening Java's Access Control by Abolishing Implicit Privilege Elevation

Philipp Holzinger, Ben Hermann, Johannes Lerch, Eric Bodden, Mira Mezini

Abstract

While the Java runtime is installed on billions of devices and servers worldwide, it remains a primary attack vector for online criminals. As recent studies show, the majority of all exploited Java vulnerabilities comprise incorrect or insufficient implementations of access-control checks. This paper for the first time studies the problem in depth. As we find, attacks are enabled by shortcuts that short-circuit Java's general principle of stack-based access control. These shortcuts, originally introduced for ease of use and to improve performance, cause Java to elevate the privileges of code implicitly. As we show, this creates many pitfalls for software maintenance, making it all too easy for maintainers of the runtime to introduce blatant confuseddeputy vulnerabilities even by just applying normally semanticspreserving refactorings. How can this problem be solved? Can one implement Java's access control without shortcuts, and if so, does this implementation remain usable and efficient? To answer those questions, we conducted a tool-assisted adaptation of the Java Class Library (JCL), avoiding (most) shortcuts and therefore moving to a fully explicit model of privilege elevation. As we show, the proposed changes significantly harden the JCL against attacks: they effectively hinder the introduction of new confused-deputy vulnerabilities in future library versions, and successfully restrict the capabilities of attackers when exploiting certain existing vulnerabilities. We discuss usability considerations, and through a set of large-scale experiments show that with current JVM technology such a faithful implementation of stack-based access control induces no observable performance loss. void checkMemberAccess(Class clazz, int w) if (w != Member.PUBLIC) Class stack[] = getClassContext(); / * stack depth of 4 should be the caller * of one of the methods in java.lang.Class * that invoke checkMember access. * The stack should look like: * someCaller [3] * java.lang.Class.someReflectionAPI [2] * java.lang.Class.checkMemberAccess [1] * SecurityManager.checkMemberAccess [0] * / if ((stack.length<4) || (stack[3].getClassLoader() != clazz.getClassLoader())) checkPermission(CHECK_MEMBER_ACCESS);

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Builds on1

  1. An In-Depth Study of More Than Ten Years of Java ExploitationPhilipp Holzinger, Stefan Triller, Alexandre Bartel, Eric BoddenCCS 2016 · 40 citations

Related papers

  1. FReD: Identifying File Re-Delegation in Android System ServicesSigmund Albert Gorski III, Seaver Thorn, William Enck, Haining ChenUSENIX Security 2022
  2. Improving Java Deserialization Gadget Chain Mining via Overriding-Guided Object GenerationSicong Cao, Xiaobing Sun, Xiaoxue Wu, Lili Bo et al.ICSE 2023 · 24 citations
  3. Automatic Policy Synthesis and Enforcement for Protecting Untrusted DeserializationQuan Zhang, Yiwen Xu, Zijing Yin, Chijin Zhou et al.NDSS 2024
  4. Mind Your Keys? A Security Evaluation of Java KeystoresRiccardo Focardi, Francesco Palmarini, Marco Squarcina, Graham Steel et al.NDSS 2018 · 9 citations
  5. Acquirer: A Hybrid Approach to Detecting Algorithmic Complexity VulnerabilitiesYinxi Liu, Wei MengCCS 2022 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines