SafeStrings: Representing Strings as Structured Data

04/25/2019
by   David Kelly, et al.
0

Strings are ubiquitous in code. Not all strings are created equal, some contain structure that makes them incompatible with other strings. CSS units are an obvious example. Worse, type checkers cannot see this structure: this is the latent structure problem. We introduce SafeStrings to solve this problem and expose latent structure in strings. Once visible, operations can leverage this structure to efficiently manipulate it; further, SafeStrings permit the establishment of closure properties. SafeStringsharness the subtyping and inheritance mechanics of their host language to create a natural hierarchy of string subtypes. SafeStrings define an elegant programming model over strings: the front end use of a SafeString is clear and uncluttered, with complexity confined inside the definition of a particular SafeString. They are lightweight, language-agnostic and deployable, as we demonstrate by implementing SafeStrings in TypeScript. SafeStrings reduce the surface area for cross-site scripting, argument selection defects, and they can facilitate fuzzing and analysis.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/02/2023

An Algorithm for the Longest Common Subsequence and Substring Problem

In this note, we first introduce a new problem called the longest common...
research
09/18/2023

Hierarchy Builder: Organizing Textual Spans into a Hierarchy to Facilitate Navigation

Information extraction systems often produce hundreds to thousands of st...
research
08/04/2020

A Data-Structure for Approximate Longest Common Subsequence of A Set of Strings

Given a set of k strings I, their longest common subsequence (LCS) is th...
research
09/10/2018

On Finding a First-Order Sentence Consistent with a Sample of Strings

We investigate the following problem: given a sample of classified strin...
research
08/17/2018

An Automata-based Abstract Semantics for String Manipulation Languages

In recent years, dynamic languages, such as JavaScript or Python, have f...
research
05/23/2023

Engineering Rank/Select Data Structures for Big-Alphabet Strings

Big-alphabet strings are common in several scenarios such as information...
research
09/23/2022

Overtwisting and Coiling Highly Enhances Strain Generation of Twisted String Actuators

Twisted string actuators (TSAs) have exhibited great promise in robotic ...

Please sign up or login with your details

Forgot password? Click here to reset