Towards More Security in Data Exchange: Defining Unparsers with Context-Sensitive Encoders for Context-Free Grammars
Lars Hermerschmidt, Stephan Kugelmann, Bernhard Rumpe

TL;DR
This paper introduces a method to derive context-sensitive encoders from context-free grammars to ensure secure, correct unparsing of data, preventing injection vulnerabilities across various languages.
Contribution
It presents a novel approach to integrate context-sensitive encoding into context-free grammars, enabling automatic generation of secure encoders and decoders during (un)parsing.
Findings
Provides a generator for context-sensitive encoders and decoders
Ensures input data does not alter document structure or semantics
Reduces security risks like injection attacks during data exchange
Abstract
To exchange complex data structures in distributed systems, documents written in context-free languages are exchanged among communicating parties. Unparsing these documents correctly is as important as parsing them correctly because errors during unparsing result in injection vulnerabilities such as cross-site scripting (XSS) and SQL injection. Injection attacks are not limited to the web world. Every program that uses input to produce documents in a context-free language may be vulnerable to this class of attack. Even for widely used languages such as HTML and JavaScript, there are few approaches that prevent injection attacks by context-sensitive encoding, and those approaches are tied to the language. Therefore, the aim of this paper is to derive context-sensitive encoder from context-free grammars to provide correct unparsing of maliciously crafted input data for all context-free…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
