Deriving Static Security Testing from Runtime Security Protection for Web Applications
Angel Luis Scull Pupo, Jens Nicolay

, and Elisa Gonzalez Boix
(Vrije Universiteit Brussel, Belgium)
Context: Static Application Security Testing (SAST) and Runtime Application Security Protection (RASP) are important and complementary techniques used for detecting and enforcing application-level security policies in web applications.
Inquiry: The current state of the art, however, does not allow a safe and efficient combination of SAST and RASP based on a shared set of security policies, forcing developers to reimplement and maintain the same policies and their enforcement code in both tools.
Approach: In this work, we present a novel technique for deriving SAST from an existing RASP mechanism by using a two-phase abstract interpretation approach in the SAST component that avoids duplicating the effort of specifying security policies and implementing their semantics. The RASP mechanism enforces security policies by instrumenting a base program to trap security-relevant operations and execute the required policy enforcement code. The static analysis of security policies is then obtained from the RASP mechanism by first statically analyzing the base program without any traps. The results of this first phase are used in a second phase to detect trapped operations and abstractly execute the associated and unaltered RASP policy enforcement code.
Knowledge: Splitting the analysis into two phases enables running each phase with a specific analysis configuration, rendering the static analysis approach tractable while maintaining sufficient precision.
Grounding: We validate the applicability of our two-phase analysis approach by using it to both dynamically enforce and statically detect a range of security policies found in related work. Our experiments suggest that our two-phase analysis can enable faster and more precise policy violation detection compared to analyzing the full instrumented application under a single analysis configuration.
Importance: Deriving a SAST component from a RASP mechanism enables equivalent semantics for the security policies across the static and dynamic contexts in which policies are verified during the software development lifecycle. Moreover, our two-phase abstract interpretation approach does not require RASP developers to reimplement the enforcement code for static analysis.
@InProceedings{Programming Journal, Volume22p1,
author = {Angel Luis Scull Pupo and Jens Nicolay and Elisa Gonzalez Boix},
title = {Deriving Static Security Testing from Runtime Security Protection for Web Applications},
booktitle = {Proc.\ Programming Journal, Volume},
publisher = {AOSA},
pages = {1--41},
doi = {10.22152/programming-journal.org/2022/6/1},
year = {2022},
}
Publisher's Version
Sham: A DSL for Fast DSLs
Rajan Walia, Chung-chieh Shan

, and Sam Tobin-Hochstadt
(Indiana University, USA)
Domain-specific languages (DSLs) are touted as both easy to embed in
programs and easy to optimize. Yet these goals are often in
tension. Embedded or internal DSLs fit naturally with a host language,
while inheriting the host's performance characteristics. External DSLs
can use external optimizers and languages but sit apart from
the host.
We present Sham, a toolkit designed to enable internal DSLs with high
performance. Sham provides a domain-specific language (embedded in
Racket) for implementing other high-performance DSLs, with transparent
compilation to assembly code at runtime. Sham is well suited as both a
compilation target for other embedded DSLs and for transparently
replacing DSL support code with faster versions. Sham provides
seamless inter-operation with its host language without requiring any
additional effort from its users. Sham also provides a framework for
defining language syntax which implements Sham's own language
interface as well.
We validate Sham's design on a series of case studies, ranging from
Krishnamurthi's classic automata DSL to a sound synthesis DSL and a
probabilistic programming language. All of these are existing DSLs
where we replaced the backend using Sham, resulting in major
performance gains. We present an example-driven description of how
Sham can smoothly enhance an existing DSL into a high-performance one.
When compared to existing approaches for implementing high-performance
DSLs, Sham's design aims for both simplicity and programmer
control. This makes it easier to port our techniques to other
languages and frameworks, or borrow Sham's innovations "à la carte"
without adopting the whole approach.
Sham builds a sophisticated and powerful DSL construction toolkit atop
fundamental language features including higher-order functions, data
structures, and a foreign-function interface (FFI), all readily
available in other languages.
Furthermore, Sham's approach allows DSL developers to simply write
functions, either using Sham or generating Sham, without needing to
work through complex staging or partial evaluation systems.
@InProceedings{Programming Journal, Volume22p123,
author = {Rajan Walia and Chung-chieh Shan and Sam Tobin-Hochstadt},
title = {Sham: A DSL for Fast DSLs},
booktitle = {Proc.\ Programming Journal, Volume},
publisher = {AOSA},
pages = {123--153},
doi = {10.22152/programming-journal.org/2022/6/4},
year = {2022},
}
Publisher's Version