# US 10,375,107 B2 · Method and apparatus for dynamic content marking to facilitate context-aware output escaping

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,375,107 B2
- Document ID: US10375107B2
- Status: Granted
- Kind: B2
- Application number: 12/841,814
- Filed: 2010-07-22
- Published: 2012-01-26
- Granted: 2019-08-06
- Earliest claimed: 2010-07-22
- Assignees: International Business Machines Corporation
- Applicants: Olgierd Pieczul; Mark Alexander McGloin; Mary Ellen Zurko
- Inventors: Olgierd Pieczul; Mark Alexander McGloin; Mary Ellen Zurko
- Web page: https://patentgrep.com/patent/US10375107B2

## CPC

- H04L 63/1466: {Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks}
- G06F 21/51: at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability
- H04L 67/02: based on web technology, e.g. hypertext transfer protocol [HTTP]
- G06F 2221/2119: Authenticating web pages, e.g. with suspicious links
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A technique to provide runtime output sanitization filtering of web application content that contains multiple contexts in which dynamic output is included. To facilitate this operation, dynamically-generated content is prepared for sanitization in advance, preferably by being “marked” by the web application itself (or by middleware). Preferably, given dynamically-generated content is marked by enclosing it between dynamic content indicators. After the document generation is completed but before it is output, the application-generated content is processed by a content sanitization filter. The filter uses the dynamic content identifiers to identify and locate the content that needs output escaping. The filter detects the appropriate context within which the dynamically-generated content has been placed and applies escaping. The output content is prepared for escaping in advance even if assembled from multiple sources that do not operate in the same runtime environment.

## Claims

### Claim 1

A method, comprising:
generating a dynamic output marking, by a dynamic content marking function, to selectively mark a plurality of pieces of dynamically-generated content being output by a web application to obtain a set of marked content, the dynamic content marking function being associated with a sanitization filter function deployed separately from, and not integrated with, the dynamic content marking function;
outputting, by the dynamic content marking function, the set of marked content to an output buffer;
determining that the set of marked content in the output buffer represents a full set of content;
responsive to the determination that the set of marked content in the output buffer represents a full set of content, providing the full set of content from the output buffer to the sanitization filter function, the sanitization filter function having been further configured to identify the full set of content using one or more string values included with the full set of content;
wherein:
lack of integration of the dynamic marking content function and the sanitization filter function decouples: (i) a determination about a need to sanitize the plurality of pieces of dynamically-generated content affected by the selective marking of the dynamic content marking function, and (ii) sanitization performed by the sanitization filter function; and
the lack of integration of the dynamic content marking function and the sanitization filter function allows the sanitizing, by the sanitization filter function, to occur after the full set of content is ready to be examined, as determined using the one or more string values.

### Claim 2 (depends on 1)

The method as defined in claim 1 wherein the dynamic content marking function is located at a remote location with respect to the sanitization function.

### Claim 3 (depends on 1)

The method as defined in claim 1 wherein the dynamic content marking function is implemented as a library function that is called by the web application.

### Claim 4

An apparatus, comprising:
a processor;
computer memory holding computer program instructions that when executed by the processor perform operations, comprising:
generating a dynamic output marking, by a dynamic content marking function, to selectively mark a plurality of pieces of dynamically-generated content being output by a web application to obtain a set of marked content, the dynamic content marking function being associated with a sanitization filter function deployed separately from, and not integrated with, the dynamic content marking function;
outputting, by the dynamic content marking function, the set of marked content to an output buffer;
determining that the set of marked content in the output buffer represents a full set of content;
responsive to the determination that the set of marked content in the output buffer represents a full set of content, providing the full set of content from the output buffer to the sanitization filter function, the sanitization filter function having been further configured to identify the full set of content using one or more string values included with the full set of content;
wherein:
lack of integration of the dynamic marking content function and the sanitization filter function decouples: (i) a determination about a need to sanitize the plurality of pieces of dynamically-generated content affected by the selective marking of the dynamic content marking function, and (ii) sanitization performed by the sanitization filter function; and
the lack of integration of the dynamic content marking function and the sanitization filter function allows the sanitizing, by the sanitization filter function, to occur after the full set of content is ready to be examined, as determined using the one or more string values.

### Claim 5 (depends on 4)

The apparatus as described in claim 4 wherein the dynamic content marking function is located at a remote location with respect to the sanitization function.

### Claim 6 (depends on 4)

The apparatus as described in claim 4 wherein the dynamic content marking function is implemented as a library function that is called by the web application.

### Claim 7

A computer program product in a non-transitory computer readable medium for use in a data processing system, the computer program product holding computer program instructions that when executed by the data processing system perform operations, comprising:
generating a dynamic output marking, by a dynamic content marking function, to selectively mark a plurality of pieces of dynamically-generated content being output by a web application to obtain a set of marked content, the dynamic content marking function being associated with a sanitization filter function deployed separately from, and not integrated with, the dynamic content marking function;
outputting, by the dynamic content marking function, the set of marked content to an output buffer;
determining that the set of marked content in the output buffer represents a full set of content;
responsive to the determination that the set of marked content in the output buffer represents a full set of content, providing the full set of content from the output buffer to the sanitization filter function, the sanitization filter function having been further configured to identify the full set of content using one or more string values included with the full set of content;
wherein:
lack of integration of the dynamic marking content function and the sanitization filter function decouples: (i) a determination about a need to sanitize the plurality of pieces of dynamically-generated content affected by the selective marking of the dynamic content marking function, and (ii) sanitization performed by the sanitization filter function; and
the lack of integration of the dynamic content marking function and the sanitization filter function allows the sanitizing, by the sanitization filter function, to occur after the full set of content is ready to be examined, as determined using the one or more string values.

### Claim 8 (depends on 7)

The computer program product as defined in claim 7 wherein the dynamic content marking function is located at a remote location with respect to the sanitization function.

### Claim 9 (depends on 7)

The computer program product as defined in claim 7 wherein the dynamic content marking function is implemented as a library function that is called by the web application.

### Claim 10 (depends on 1)

The method as defined in claim 1 wherein the sanitization filter function is deployed in a cloud computing operating environment.

### Claim 11 (depends on 4)

The apparatus as defined in claim 4 wherein the sanitization filter function is deployed in a cloud computing operating environment.

### Claim 12 (depends on 7)

The computer program product as defined in claim 7 wherein the sanitization filter function is deployed in a cloud computing operating environment.
