KR101539139B1 - Filtering method and system for satisfying both security and performance - Google Patents

Filtering method and system for satisfying both security and performance Download PDF

Info

Publication number
KR101539139B1
KR101539139B1 KR1020130007863A KR20130007863A KR101539139B1 KR 101539139 B1 KR101539139 B1 KR 101539139B1 KR 1020130007863 A KR1020130007863 A KR 1020130007863A KR 20130007863 A KR20130007863 A KR 20130007863A KR 101539139 B1 KR101539139 B1 KR 101539139B1
Authority
KR
South Korea
Prior art keywords
parser
code
parsing
filtering
memory
Prior art date
Application number
KR1020130007863A
Other languages
Korean (ko)
Other versions
KR20140095217A (en
Inventor
우성민
Original Assignee
네이버 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 네이버 주식회사 filed Critical 네이버 주식회사
Priority to KR1020130007863A priority Critical patent/KR101539139B1/en
Publication of KR20140095217A publication Critical patent/KR20140095217A/en
Application granted granted Critical
Publication of KR101539139B1 publication Critical patent/KR101539139B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity

Abstract

보안 및 성능 모두를 만족시키기 위한 필터링 방법 및 시스템이 개시된다. 코드를 필터링하는 필터링 방법은, 현재 사용 가능한 메모리 용량을 확인하는 단계, 상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하는 단계, 상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하는 단계, 상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하는 단계 및 상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하는 단계를 포함할 수 있다.A filtering method and system for satisfying both security and performance are disclosed. The filtering method for filtering the code includes the steps of checking the currently available memory capacity, calculating the expected amount of memory usage when parsing through the first parser by checking the capacity of the code Selecting one of the first parser and the second parser based on the memory capacity and the memory usage, proceeding with parsing of the code through the selected parser to generate a parsing result, And performing filtering of the code using a parsing result.

Description

보안 및 성능 모두를 만족시키기 위한 필터링 방법 및 시스템{FILTERING METHOD AND SYSTEM FOR SATISFYING BOTH SECURITY AND PERFORMANCE}TECHNICAL FIELD [0001] The present invention relates to a filtering method and system for satisfying both security and performance.

본 발명의 실시예들은 보안 및 성능 모두를 만족시키기 위한 필터링 방법 및 시스템에 관한 것이다.Embodiments of the present invention relate to a filtering method and system for satisfying both security and performance.

XSS(Cross Site Scripting)는 타 사용자의 정보를 추출하기 위해 사용되는 공격 기법으로, 게시판이나 검색입력 창과 같이 사용자의 입력을 받는 부분에 공격자가 스크립트 코드(XSS 코드)를 삽입하여 XSS 코드가 삽입된 내용을 열람한 타 사용자의 정보로 로그인하거나 개인정보를 탈취하는 등의 악의적인 행동이 가능해진다. 따라서, 게시판이나 검색입력 창에서 HTML(Hyper Text Markup Language)을 허용하는 경우, 사용자가 입력한 데이터에 악의적인 태그 및 스크립트가 포함되어 있는지 여부를 필터링하는 과정이 꼭 필요하다.Cross Site Scripting (XSS) is an attack technique used to extract information of other users. It is a technique that an attacker inserts script code (XSS code) into a part of a user input such as a bulletin board or a search input window, Malicious actions such as log-in with information of another user viewing the content or taking personal information can be performed. Therefore, when allowing HTML (Hyper Text Markup Language) in a bulletin board or a search input window, a process of filtering whether or not malicious tags and scripts are included in the data inputted by the user is necessary.

일례로, XSS 필터는 XSS의 위험을 줄이기 위하여, 사용자가 입력한 데이터 중에서 자바스크립트 등의 허용되지 않은 코드의 식별 및 무효화 처리를 담당하는 웹 보안 필터이다.For example, the XSS filter is a web security filter that handles the identification and invalidation of unauthorized codes such as JavaScript among data inputted by the user in order to reduce the risk of XSS.

다수의 웹 기반 사용자 서비스들은 XSS에 대한 처리를 개별 프로젝트 수준에서 개발하여 적용하거나 오픈 소스 라이브러리를 이용하기 때문에 보안 담당 부서에 의해 일괄된 XSS 보안 정책이 적용되는 것이 아니라 사용자 서비스마다 각기 다른 규칙과 로직에 의해 XSS 필터링이 수행된다는 문제점이 있으며, 메일 서비스와 같이 대용량 컨텐츠에 대해 DOM(document Object Model) 파서(parser) 방식의 XSS 필터를 사용하는 경우, OOM(Out Of Memory) 오류가 발생할 수 있는 문제점이 있다. 뿐만 아니라, 종래기술의 XSS 필터들은 잘 정형화된(welformed) HTML 코드에 대해서만 완벽한 파싱이 가능하여 비 정형화된(malformed) HTML 코드에 대한 파싱에 취약한 문제점이 있다. Many Web-based user services develop and apply XSS processing at the individual project level or use open source libraries, so the XSS security policy bundled by the security department does not apply, but different rules and logic And there is a problem that OOM (Out Of Memory) error may occur when a document object model (DOM) parser-type XSS filter is used for large-capacity contents such as a mail service. . In addition, the prior art XSS filters are vulnerable to parsing of malformed HTML code by enabling complete parsing only for well-formed HTML code.

사용 가능한 메모리 용량과 필터링 대상 코드의 용량을 비교하여 DOM(document Object Model) 마크업 파서(markup parser)와 SAX(Simple API for XML) 마크업 파서 중 하나를 선택적으로 활용함으로써, 메모리 사용량 및 필터링 속도를 향상시킬 수 있는 필터링 방법 및 필터링 시스템을 제공한다.By selectively utilizing either the document object model (DOM) markup parser or the Simple API for XML (SAX) markup parser by comparing the amount of available memory to the capacity of the code to be filtered, And a filtering system and a filtering system capable of improving the filtering performance.

DOM 마크업 파서를 이용한 파싱을 통해, 스택 오버플로우(stack overflow) 오류의 발생이 감지되는 경우, DOM 마크업 파서를 스택 오버플로우 오류가 원적적으로 발생하지 않는 SAX 마크업 파서로 자동 전환하여 파싱을 수행할 수 있는 필터링 방법 및 필터링 시스템을 제공한다.Parsing with the DOM markup parser automatically switches the DOM markup parser to a SAX markup parser that does not cause a stack overflow error when it detects the occurrence of a stack overflow error A filtering method, and a filtering system.

블랙리스트 필터링 방식이 아닌 화이트리스트 필터링 방식을 활용하여 일관된 XSS 보안 정책의 수립 및 적용이 가능한 필터링 방법 및 필터링 시스템을 제공한다.The present invention provides a filtering method and filtering system capable of establishing and applying a consistent XSS security policy using a whitelist filtering method instead of a blacklist filtering method.

코드를 필터링하는 필터링 방법에 있어서, 현재 사용 가능한 메모리 용량을 확인하는 단계, 상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하는 단계, 상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하는 단계, 상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하는 단계 및 상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하는 단계를 포함하는 필터링 방법이 제공된다.A method for filtering a code, the method comprising: checking a currently available memory capacity; estimating a capacity of the code and calculating an expected memory usage when parsing is performed through a first parser Selecting one of the first parser and the second parser based on the memory capacity and the memory usage, proceeding with parsing the code through the selected parser to produce a parsing result, And performing filtering of the code using the parsed result.

일측에 따르면, 상기 제1 파서는, 상기 코드에 포함된 전체 태그에 대한 트리를 상기 파싱 결과로서 생성하여 제공하는 파서를 포함하고, 상기 제2 파서는 상기 코드에 포함된 태그들을 상기 파싱 결과로서 순차적으로 제공하는 파서를 포함하는 것을 특징으로 할 수 있다.According to one aspect, the first parser includes a parser that generates and provides a tree for the entire tag included in the code as the parsing result, and the second parser parses the tags included in the code as the parsing result And a parser for sequentially providing the parser.

다른 측면에 따르면, 상기 하나의 파서를 선택하는 단계는, 상기 메모리 용량 및 상기 메모리 사용량을 비교하여 상기 제1 파서(parser)를 이용한 파싱을 통해 OOM(Out Of Memory) 오류가 발생하는지 여부를 판단하는 단계 및 상기 OOM 오류가 발생하지 않는 경우에 상기 제1 파서를 선택하고, 상기 OOM 오류가 발생하는 경우에 상기 제2 파서를 선택하는 단계를 포함하는 것을 특징으로 할 수 있다.According to another aspect, the step of selecting the one parser may include comparing the memory capacity and the memory usage to determine whether or not an Out Of Memory (OOM) error occurs through parsing using the first parser Selecting the first parser when the OOM error does not occur, and selecting the second parser if the OOM error occurs.

또 다른 측면에 따르면, 상기 하나의 파서를 선택하는 단계는, 상기 메모리 용량이 상기 메모리 사용량보다 기설정된 용량 이상 큰 경우, 상기 제1 파서를 선택하고, 상기 메모리 용량이 상기 메모리 사용량보다 상기 기설정된 용량 이상 크지 않은 경우, 상기 제2 파서를 선택하는 것을 특징으로 할 수 있다.According to another aspect of the present invention, the selecting of the one parser may include selecting the first parser when the memory capacity is larger than the memory capacity by a preset capacity or more, And selects the second parser if the capacity of the second parser is not greater than the capacity.

또 다른 측면에 따르면, 상기 파싱 결과를 생성하는 단계는, 상기 제1 파서가 상기 하나의 파서로 선택된 경우, 상기 제1 파서를 이용하여 상기 코드의 파싱을 진행하면서, 스택 오버플로우(stack overflow) 오류의 발생 여부를 모니터링하는 단계 및 상기 스택 오버플로우 오류의 발생이 감지되는 경우, 상기 선택된 제1 파서를 상기 제2 파서로 전환하여 상기 제2 파서를 통해 상기 코드의 파싱을 재수행하여 상기 파싱 결과를 생성하는 단계를 포함하는 것을 특징으로 할 수 있다.According to another aspect, the step of generating the parsing result comprises: if the first parser is selected as the one parser, performing parsing of the code using the first parser, Monitoring whether or not an error has occurred; and when the occurrence of the stack overflow error is detected, switching the selected first parser to the second parser to re-execute the code through the second parser, And a step of generating the generated image data.

또 다른 측면에 따르면, 상기 코드의 필터링을 수행하는 단계는, 상기 파싱 결과와 화이트리스트 설정을 비교하여 상기 파싱 결과에 포함된 코드(또는 태그)들 중 상기 화이트리스트 설정을 통해 허용된 코드(또는 태그)들을 제외한 나머지 코드(또는 태그)들을 변경 또는 삭제하여 상기 코드에 대한 필터링을 수행하는 것을 특징으로 할 수 있다.According to another aspect, the step of performing the filtering of the code may include comparing the parsing result with a whitelist setting to determine whether the code (or tags) allowed in the parsing result (Or tags) other than the tags (e.g., tags) are changed or deleted to perform filtering on the codes.

또 다른 측면에 따르면, 상기 화이트리스트 설정은, 화이트리스트 상위 설정 파일의 필터링 규칙이 화이트리스트 하위 설정 파일로 상속 또는 오버라이딩되도록 구현되는 것을 특징으로 할 수 있다.According to another aspect, the white list setting may be implemented such that the filtering rule of the white list upper setting file is inherited or overridden as the white list lower setting file.

코드를 필터링하는 필터링 시스템에 있어서, 적어도 하나의 프로세서 및 적어도 하나의 메모리를 포함하고, 상기 적어도 하나의 프로세서는, 상기 적어도 하나의 메모리에 대해, 현재 사용 가능한 메모리 용량을 확인하고, 상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하고, 상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하고, 상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하고, 상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하는 것을 특징으로 하는 필터링 시스템이 제공된다.CLAIMS What is claimed is: 1. A filtering system for filtering code, comprising: at least one processor; and at least one memory, wherein the at least one processor is configured to: determine, for the at least one memory, A parser for calculating a memory usage expected when parsing is performed through a first parser based on the memory capacity and the memory usage, The parsing of the code is performed through the selected parser to generate a parsing result, and the filtering of the code is performed using the parsing result.

코드를 필터링하기 위한 라이브러리를 제공하는 라이브러리 제공 시스템에 있어서, 상기 라이브러리의 설치를 위한 파일을 클라이언트 시스템으로 제공하는 파일 제공부를 포함하고, 상기 라이브러리는, 상기 적어도 하나의 메모리에 대해, 현재 사용 가능한 메모리 용량을 확인하도록 상기 클라이언트 시스템을 제어하는 모듈, 상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하도록 상기 클라이언트 시스템을 제어하는 모듈, 상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하도록 상기 클라이언트 시스템을 제어하는 모듈, 상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하도록 상기 클라이언트 시스템을 제어하는 모듈 및 상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하도록 상기 클라이언트 시스템을 제어하는 모듈을 포함하는 것을 특징으로 하는 라이브러리 제공 시스템이 제공된다.A library providing system for providing a library for filtering codes, the library providing system comprising: a file providing unit for providing a file for installing the library to a client system, the library including: A module for controlling the client system to check the capacity of the client system, a module for controlling the client system to calculate the expected amount of memory usage in case of parsing through the first parser, A module for controlling the client system to select a parser of one of the first parser and the second parser based on the memory capacity and the amount of memory usage; parsing the code through the selected parser to generate a parsing result The client system This library providing system characterized in that it comprises a module for controlling the system such that client by using the control module and the parsing result of performing the filtering of the generated code is provided.

사용 가능한 메모리 용량과 필터링 대상 코드의 용량을 비교하여 DOM(document Object Model) 마크업 파서(markup parser)와 SAX(Simple API for XML) 마크업 파서 중 하나를 선택적으로 활용할 수 있다.You can selectively use either the document object model (DOM) markup parser or the Simple API for XML (SAX) markup parser by comparing the amount of available memory to the capacity of the code to be filtered.

DOM 마크업 파서를 이용한 파싱을 통해, 스택 오버플로우(stack overflow) 오류의 발생이 감지되는 경우, DOM 마크업 파서를 스택 오버플로우 오류가 원적적으로 발생하지 않는 SAX 마크업 파서로 자동 전환하여 파싱을 수행할 수 있다.Parsing with the DOM markup parser automatically switches the DOM markup parser to a SAX markup parser that does not cause a stack overflow error when it detects the occurrence of a stack overflow error Can be performed.

블랙리스트 필터링 방식이 아닌 화이트리스트 필터링 방식을 활용하여 일관된 XSS 보안 정책을 수립 및 적용할 수 있다.By using the whitelist filtering method instead of the blacklist filtering method, a consistent XSS security policy can be established and applied.

도 1은 본 발명의 일실시예에 있어서, 필터링 시스템의 일례를 설명하기 위한 블록도이다.
도 2는 본 발명의 일실시예에 있어서, 필터링 과정의 일례를 설명하기 위한 흐름도이다.
도 3은 본 발명의 일실시예에 있어서, OOM 오류를 방지하기 위한 방법의 일례를 설명하기 위한 흐름도이다.
도 4는 본 발명의 일실시예에 있어서, 스택 오버플로우 오류를 방지하기 위한 방법의 일례를 설명하기 위한 흐름도이다.
도 5는 본 발명의 일실시예에 있어서, 필터링 시스템 및 파일 제공 시스템을 도시한 블록도이다.
도 6은 본 발명의 일실시예에 있어서, 필터링 방법을 도시한 흐름도이다.
1 is a block diagram for explaining an example of a filtering system in an embodiment of the present invention.
2 is a flowchart for explaining an example of a filtering process in an embodiment of the present invention.
3 is a flow chart for explaining an example of a method for preventing an OOM error in an embodiment of the present invention.
4 is a flow chart for explaining an example of a method for preventing a stack overflow error in an embodiment of the present invention.
Figure 5 is a block diagram illustrating a filtering system and a file provisioning system in one embodiment of the present invention.
6 is a flow chart illustrating a filtering method in an embodiment of the present invention.

이하, 본 발명의 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 발명의 일시예들에 따른 필터링 시스템은 일관된 XSS(Cross Site Scripting) 보안 정책 수립 및 적용이 가능하도록 xml(extensible markup language) 기반의 화이트리스트 필터링 방식을 사용할 수 있다. 또한, 필터링 시스템은 DOM(document Object Model) 파서(parser) 뿐만 아니라, 메모리 사용량 및 속도가 개선되고 스택 오버플로우(stack overflow) 오류가 발생하지 않는 SAX (Simple API for XML) 파서를 선택적으로 또는 적응적으로 이용하여 OOM(Out Of Memory) 오류의 발생을 막을 수 있으며, 비 정형화된(malformed) 코드(일례로, HTML 코드)에 대해서도 적절한 파싱(parsing)을 수행할 수 있다.The filtering system according to the exemplary embodiments of the present invention can use an xml (extensible markup language) based whitelist filtering scheme to establish and apply a consistent XSS (Cross Site Scripting) security policy. In addition, the filtering system can selectively or adapt the SAX (Simple API for XML) parser, which improves memory usage and speed, and does not cause stack overflow errors, as well as a DOM (document object model) parser It is possible to prevent the occurrence of OOM (Out Of Memory) error and to perform proper parsing for malformed code (for example, HTML code).

도 1은 본 발명의 일실시예에 있어서, 필터링 시스템의 일례를 설명하기 위한 블록도이고, 도 2는 본 발명의 일실시예에 있어서, 필터링 과정의 일례를 설명하기 위한 흐름도이다. 본 실시예에 따른 필터링 시스템(100)은 적어도 하나의 프로세서(미도시)와 적어도 하나의 메모리(미도시)를 포함할 수 있다. 이때, 적어도 하나의 프로세서에 의해 코드의 필터링을 위한 필터 객체(110)가 생성될 수 있다. 예를 들어, 필터 객체(110)는 입력 코드(120)를 필터링하여 출력 코드를 생성 및 제공하기 위한 라이브러리 모듈로, 입력 코드의 필터링을 위해 적어도 하나의 프로세서에 의해 생성될 수 있다. 이 경우, 생성된 필터 객체(110)는 상술한 적어도 하나의 메모리에 적재(loading)될 수 있다.FIG. 1 is a block diagram for explaining an example of a filtering system in an embodiment of the present invention. FIG. 2 is a flowchart for explaining an example of a filtering process in an embodiment of the present invention. The filtering system 100 according to the present embodiment may include at least one processor (not shown) and at least one memory (not shown). At this time, a filter object 110 for filtering the code may be generated by at least one processor. For example, the filter object 110 is a library module for filtering input code 120 to generate and provide an output code, and may be generated by at least one processor for filtering the input code. In this case, the generated filter object 110 may be loaded into the at least one memory described above.

필터 객체(110)는 도 1에 도시된 바와 같이, 필터 코어(filter core)(111), 설정 빌더(configuration builder)(112) 및 파서(113)를 포함할 수 있다. 여기서, 필터 객체(110), 필터 코어(filter core)(111), 설정 빌더(configuration builder)(112) 및 파서(113)는 각각 적어도 하나의 프로세서의 동작을 제어하기 위한 라이브러리 모듈일 수 있다.The filter object 110 may include a filter core 111, a configuration builder 112, and a parser 113, as shown in FIG. Here, the filter object 110, the filter core 111, the configuration builder 112, and the parser 113 may each be a library module for controlling the operation of at least one processor.

여기서, 본 실시예에 따른 필터링 과정에 포함된 단계들은 필터링 시스템(100) 또는 필터링 시스템(100)이 포함하는 적어도 하나의 프로세서에 의해 수행될 수 있다. 이후에서는 설명의 편의를 위해, 각 단계들이 필터링 시스템(100)에 의해 수행되는 것으로 설명한다.Here, the steps included in the filtering process according to the present embodiment may be performed by at least one processor included in the filtering system 100 or the filtering system 100. Hereinafter, for convenience of explanation, it is assumed that each step is performed by the filtering system 100.

단계(210)에서 필터링 시스템(100)은 입력 코드(120)의 필터링을 위해 필터 객체(110)가 생성되면, 화이트리스트 설정(white list configuration)(140)에 정의된 내용을 설정 빌더(112)로 리딩(reading)할 수 있다. 여기서, 화이트리스트 설정 방식은 미리 기술된 설정 내용만을 허용하고, 다른 모든 부분에 대하여 필터링을 수행하는 설정 방식으로, 보안성이 뛰어나다. 일례로, 허용되지 않는 내용을 기술하는 방식의 블랙리스트(black list) 설정 방식은 신규공격 패턴을 막을 수 없기 때문에 보안에 취약하다. 일례로, 화이트리스트 설정(140)은 xml 파일의 형태로 저장 및 유지될 수 있다. 이때, 화이트리스트 설정은 화이트리스트 상위 설정 파일에 대한 상속(일례로, 자바 환경에서의 객체(object) 또는 클래스(class)의 상속) 및 오버라이딩(overriding)이 가능하도록 구현될 수 있다. 따라서, 파일 객체(110)에서는 상위 설정 파일을 상속받는 것만으로도 기본 보안 정책이 파일 객체(110)에 적용될 수 있다. 또한, 서비스에 따라 변경이 불가피한 필터링 규칙은 하위 파일에서 재정의할 수 있기 때문에 서비스에 맞게 필터링 규칙을 수정하는 것도 가능해진다. In operation 210, the filtering system 100 may generate the filter object 110 for filtering the input code 120, and send the contents defined in the white list configuration 140 to the setting builder 112. [ As shown in FIG. Here, the white list setting method is a setting method that permits only the previously described setting contents and performs filtering for all other parts, and is excellent in security. For example, a black list setting scheme that describes unacceptable content is vulnerable to security because it can not prevent new attack patterns. In one example, the whitelist setting 140 may be stored and maintained in the form of an xml file. At this time, the whitelist setting can be implemented so that inheritance (for example, inheritance of an object or a class in the Java environment) and overriding of the whitelist upper configuration file are possible. Therefore, in the file object 110, the basic security policy can be applied to the file object 110 by inheriting the parent configuration file. In addition, since filtering rules that can not be changed according to the service can be redefined in the lower file, it is also possible to modify the filtering rule according to the service.

단계(220)에서 필터링 시스템(100)은 화이트 리스트 설정(140)을 필터 코어(111)로 전달할 수 있다. 이때, 화이트 리스트 설정(140)의 전달을 통해 필터링을 위한 초기화 작업이 이루어질 수 있다. 예를 들어, 보안 정책과 같은 필터링 규칙들이 화이트 리스트 설정(140)을 이용하여 적용될 수 있다. 도 1에 도시된 바와 같이, 필터 객체(110)는 설정 빌더(112)를 통해 개별적으로 화이트리스트 설정을 리딩하여 필터 코어(111)로 전달하고, 필터 코어(111)에서 화이트리스트 설정이 적용되기 때문에 서비스마다 서로 다른 규칙과 로직을 이용하는 것이 아니라, 일관되고 통합된 XSS 보안 정책을 적용하는 것이 가능해진다.In step 220, the filtering system 100 may forward the whitelist setting 140 to the filter core 111. At this time, an initialization operation for filtering may be performed through delivery of the white list setting 140. [ For example, filtering rules, such as security policies, may be applied using the whitelist setting 140. As shown in Figure 1, the filter object 110 reads the white list settings individually through the configuration builder 112 and passes them to the filter core 111, and the white list settings are applied at the filter core 111 It is therefore possible to apply a consistent and integrated XSS security policy rather than using different rules and logic for each service.

단계(230)에서 필터링 시스템(100)은 입력 코드(120)를 파서(113)로 제공한다. 이때, 입력 코드는 필터링 되지 않은 HTML 코드로서, 악의적인 XSS 코드를 포함할 수 있다. 일례로, 입력 코드(120)는 필터 코어(111)를 통해 파서(113)로 전달될 수 있다. 본 실시예에서 파서(113)는 DOM 파서(114)와 SAX 파서(115)를 모두 포함할 수 있다. 이때, DOM 파서(114)와 SAX 파서(115) 중 어느 파서를 이용하여 입력 코드(120)를 파싱할 것인가는, 필터 코어(111)에 의해 결정될 수도 있고, 파서(113)에 의해 결정될 수도 있다.In step 230, the filtering system 100 provides the input code 120 to the parser 113. At this time, the input code is unfiltered HTML code and may contain malicious XSS code. In one example, the input code 120 may be passed to the parser 113 through the filter core 111. In this embodiment, the parser 113 may include both a DOM parser 114 and a SAX parser 115. At this time, which parser of the DOM parser 114 and the SAX parser 115 is to be used to parse the input code 120 may be determined by the filter core 111 or may be determined by the parser 113 .

예를 들어, 필터 객체(110)로 입력 코드(120)가 전달되는 경우, 입력 코드(120)와 함께 사용옵션이 더 전달될 수 있다. 이때, 사용옵션은 아래 (1) 내지 (3)과 같이 세 가지 옵션 중 선택된 하나의 옵션에 대한 정보를 포함할 수 있다.For example, if the input code 120 is passed to the filter object 110, the use option may be passed along with the input code 120. [ At this time, the use option may include information on one of the three options as shown in the following (1) to (3).

(1) DOM 방식을 사용하는 옵션 - 일례로, DOM 파서(114)를 이용하여 입력 코드(120)를 파싱함.(1) Options using the DOM scheme - For example, the DOM parser 114 is used to parse the input code 120.

(2) SAX 방식을 사용하는 옵션 - 일례로, SAX 파서(115)를 이용하여 입력 코드(120)를 파싱함.(2) Option using SAX method - For example, the SAX parser 115 is used to parse the input code 120.

(3) DOM 방식을 기본적으로 사용하되, 필요에 따라 SAX 방식으로 자동전환하여 SAX 방식을 사용하는 옵션 - 일례로, DOM 파서(114)를 이용하여 입력 코드(120)를 파싱함에 있어서, OOM 오류의 발생이 예상되는 경우, 또는 DOM 파서(114)를 이용하여 입력 코드(120)를 파싱하는 도중에 스택 오버플로우 오류가 발생하는 경우, DOM 파서(114)를 SAX 파서(115)로 전환하여 SAX 파서(115)를 이용하여 입력 코드(120)를 파싱함.(3) Option to basically use the DOM method and automatically switch to the SAX method as needed to use the SAX method. For example, in parsing the input code 120 using the DOM parser 114, the OOM error Or when a stack overflow error occurs during the parsing of the input code 120 using the DOM parser 114, the DOM parser 114 is switched to the SAX parser 115, The input code 120 is parsed using the input code 115. FIG.

옵션 (3)과 관련하여 DOM 파서(114)를 SAX 파서(115)로 전환하는 조건과 방법에 대해서는 도 3 및 도 4를 통해 더욱 자세히 설명한다.Conditions and a method for converting the DOM parser 114 to the SAX parser 115 in connection with the option (3) will be described in more detail with reference to FIG. 3 and FIG.

단계(240)에서 필터링 시스템(100)은 파서(113)를 통해 입력 코드(120)를 파싱하여 필터 코어(111)로 전달할 수 있다. 이때, DOM 파서(114)를 이용하는 경우, 파서(113)에서는 전체 코드 DOM 태그 트리가 생성될 수 있고, 생성된 전체 코드 DOM 태그 트리가 필터 코어(111)로 전달될 수 있다. 또한, SAX 파서(115)를 이용하는 경우에는 전체 코드가 아니라, 순서대로 태그를 하나씩 읽어내어 필터 코어(111)로 전달하는 스트리밍 방식을 통해 태그들이 필터 코어(111)로 전달될 수 있다.The filtering system 100 may pass the input code 120 through the parser 113 to the filter core 111 in step 240. At this time, when the DOM parser 114 is used, the entire code DOM tag tree can be generated in the parser 113, and the generated entire code DOM tag tree can be transmitted to the filter core 111. [ When the SAX parser 115 is used, the tags may be transmitted to the filter core 111 through a streaming method in which the tags are read one by one and are transferred to the filter core 111 in order, rather than the entire code.

단계(250)에서 필터링 시스템(100)은 필터 코어(111)를 통해 파서(113)의 파싱 결과와 화이트 리스트 설정(140)을 비교하여 입력 코드(120)를 필터링할 수 있다. 예를 들어, 필터 코어(111)에서는 파싱 결과와 화이트 리스트 설정(140)을 비교를 통해 허용된 코드를 제외한 나머지 코드들이 필터링되어 제공될 수 있다. 이때, DOM 파서(114)를 통해 제공된 파싱 결과는 전체 코드 DOM 태그 트리를 구성하기 때문에 자식태그의 삭제나 교정 등과 같이 코드의 구조를 변경하는 것이 가능하다. 또한, SAX 파서(114)를 통해 제공된 파싱 결과를 통해서는 코드의 구조를 변경하는 것은 불가능하나, 스트리밍 방식을 사용하기 때문에 속도가 빠르고, 메모리 사용량을 대폭 감소시킬 수 있다. 따라서, 상술한 사용옵션을 통해 적절한 파서를 선택적으로 활용함으로써, 보안과 성능을 모두 만족시킬 수 있는 필터링 시스템(100)을 제공하는 것이 가능해진다.The filtering system 100 in step 250 may filter the input code 120 by comparing the parsing result of the parser 113 with the white list setting 140 via the filter core 111. [ For example, in the filter core 111, the parsing result and the whitelist setting 140 may be provided by filtering the remaining codes except for the allowed code. At this time, since the parsing result provided through the DOM parser 114 constitutes the entire code DOM tag tree, it is possible to change the structure of the code such as deletion or correction of child tags. In addition, it is not possible to change the structure of the code through the parsing result provided through the SAX parser 114, but since the streaming method is used, the speed is fast and the memory usage can be greatly reduced. Accordingly, by selectively using an appropriate parser through the use option described above, it becomes possible to provide a filtering system 100 that can satisfy both security and performance.

도 3은 본 발명의 일실시예에 있어서, OOM 오류를 방지하기 위한 방법의 일례를 설명하기 위한 흐름도이다. 본 실시예에 따른 방법은 도 1을 통해 설명한 필터링 시스템(100)에 의해 수행될 수 있다. 일례로, 필터링 시스템(100)은 도1을 통해 설명한 필터 객체(110)를 이용하여 또는 필터 객체(110)의 제어를 통해 본 실시예에 따른 방법을 수행할 수 있다.3 is a flow chart for explaining an example of a method for preventing an OOM error in an embodiment of the present invention. The method according to the present embodiment can be performed by the filtering system 100 described with reference to FIG. In one example, the filtering system 100 may perform the method according to the present embodiment using the filter object 110 described above with reference to FIG. 1 or through control of the filter object 110.

단계(310)에서 필터링 시스템(100)은 필터링이 시작되면, 현재 사용 가능한 메모리의 용량을 확인할 수 있다. 일례로, 자바(Java) 기반의 환경에서는, JVM(Java Virtual Machine)에서 사용 가능한 힙메모리(heap memory)의 용량을 확인할 수 있다.In step 310, the filtering system 100 can determine the amount of memory currently available when filtering begins. For example, in a Java-based environment, the capacity of the heap memory available in the Java Virtual Machine (JVM) can be checked.

단계(320)에서 필터링 시스템(100)은 대상 코드의 용량을 확인하여 DOM 파서를 통해 파싱을 진행하는 경우에 예상되는 메모리 사용량을 계산할 수 있다.In step 320, the filtering system 100 may calculate the expected memory usage when parsing through the DOM parser by checking the capacity of the target code.

단계(330)에서 필터링 시스템(100)은 현재 사용 가능한 메모리의 용량과 예상되는 메모리 사용량을 비교하여 OOM 오류의 발생 여부를 판단할 수 있다.In step 330, the filtering system 100 may determine whether an OOM error has occurred by comparing the amount of memory currently available with the expected memory usage.

단계(340)에서 필터링 시스템(100)은 OOM 오류의 발생 여부에 따라 DOM 파서 및 SAX 파서 중 하나의 파서를 선택하고, 선택된 하나의 파서를 통해 파싱을 진행할 수 있다. 예를 들어, 필터링 시스템(100)은 OOM 오류가 발생하지 않을 것으로 판단되는 경우에는 DOM 파서를 이용하여, OOM 오류가 발생할 것으로 판단되는 경우에는 SAX 파서를 이용하여 코드의 파싱을 진행할 수 있다. 이때, 필터링 시스템(100)은 OOM 오류의 발생 여부를 판단하기 위해, 다양한 방법을 이용할 수 있다. 예를 들어, 필터링 시스템(100)은 단순히 현재 사용 가능한 메모리의 용량이 메모리 사용량 미만인 경우, OOM 오류가 발생할 것으로 판단할 수 있다. 다른 예로, 필터링 시스템(100)은 현재 사용 가능한 메모리의 용량이 메모리 사용량보다 기설정된 용량 이상 크지 않은 경우에 OOM 오류가 발생할 것으로 판단할 수도 있다.In step 340, the filtering system 100 may select one of the DOM parser and the SAX parser depending on whether an OOM error has occurred, and proceed with parsing through the selected one parser. For example, the filtering system 100 may use a DOM parser when it is determined that an OOM error will not occur, and may parse the code using a SAX parser if it is determined that an OOM error will occur. At this time, the filtering system 100 may use various methods to determine whether an OOM error has occurred. For example, the filtering system 100 may determine that an OOM error will occur if the amount of memory currently available is less than the memory usage. As another example, the filtering system 100 may determine that an OOM error will occur if the currently available memory capacity is not greater than the memory usage by more than a predetermined amount.

이러한 파서의 선택은 DOM 파서와 SAX 파서가 갖는 특징에 따른 것이다. 예를 들어, 자바(Java) 기반의 환경에서, DOM 파서는 대상이 코드의 용량 대비 8배 정도의 메모리 사용량을 요구하는 반면, SAX 파서는 필터링의 대상이 되는 코드의 용량 대비 3배 정도의 메모리 사용량을 요구한다. 따라서, DOM 파서를 이용하는 경우에 OOM 오류가 발생할 것으로 예상되면, 필터링 시스템(100)은 DOM 파서 대신 요구 메모리 사용량이 상대적으로 작은 SAX 파서를 이용하여 코드의 파싱을 진행할 수 있다.The choice of these parsers depends on the characteristics of the DOM parser and the SAX parser. For example, in a Java-based environment, the DOM parser requires about eight times as much memory as the target, while the SAX parser has about three times as much memory as the code to be filtered Requires usage. Thus, if an OOM error is expected to occur when using a DOM parser, the filtering system 100 may proceed with parsing the code using a SAX parser with a relatively small memory requirement instead of a DOM parser.

도 4는 본 발명의 일실시예에 있어서, 스택 오버플로우 오류를 방지하기 위한 방법의 일례를 설명하기 위한 흐름도이다. 본 실시예에 따른 방법은 도 1을 통해 설명한 필터링 시스템(100)에 의해 수행될 수 있다. 일례로, 필터링 시스템(100)은 도1을 통해 설명한 필터 객체(110)를 이용하여 또는 필터 객체(110)의 제어를 통해 본 실시예에 따른 방법을 수행할 수 있다. 또한, 본 실시예에 따른 방법은 DOM 파서를 이용하여 코드의 파싱을 진행하는 과정에 포함될 수 있다.4 is a flow chart for explaining an example of a method for preventing a stack overflow error in an embodiment of the present invention. The method according to the present embodiment can be performed by the filtering system 100 described with reference to FIG. In one example, the filtering system 100 may perform the method according to the present embodiment using the filter object 110 described above with reference to FIG. 1 or through control of the filter object 110. In addition, the method according to the present embodiment can be included in the process of parsing the code using the DOM parser.

단계(410)에서 필터링 시스템(100)은 DOM 파서를 이용하여 코드의 파싱을 진행하면서, 스택 오버플로우 오류의 발생 여부를 모니터링할 수 있다.In operation 410, the filtering system 100 may monitor the occurrence of a stack overflow error while parsing the code using the DOM parser.

단계(420)에서 필터링 시스템(100)은 스택 오버플로우 오류의 발생이 감지되는 경우, DOM 파서를 SAX 파서로 자동 전환하여 파싱을 재수행할 수 있다. SAX 파서는 도 1 및 도 2를 통해 이미 설명한 바와 같이, 코드에 포함된 태그들을 순차적으로 스트리밍 방식으로 필터 코어(111)로 전달한다. 따라서, 근본적으로 스택 오버플로우 오류가 발생하지 않기 때문에, DOM 파서를 SAX 파서로 자동 전환하여 파싱을 재수행함으로써, 결과적으로, 스택 오버플로우 오류의 발생으로 인한 문제를 해결할 수 있다.In operation 420, the filtering system 100 may automatically switch the DOM parser to a SAX parser and re-execute the parsing if a stack overflow error is detected. As described above with reference to FIGS. 1 and 2, the SAX parser sequentially transmits the tags included in the code to the filter core 111 in a streaming manner. Therefore, since the stack overflow error does not occur fundamentally, the DOM parser is automatically switched to the SAX parser to redo the parsing, and as a result, the problem caused by the occurrence of the stack overflow error can be solved.

DOM 파서와 SAX 파서 중 하나의 파서를 이용하여 파싱된 파싱 결과는 도 1을 통해 설명한 필터 코어(111)로 전달되어 대상 코드의 필터링에 이용될 수 있다.The parsing result parsed using one of the DOM parser and the SAX parser may be transmitted to the filter core 111 described with reference to FIG. 1 and used for filtering the target code.

아래 표 1은 DOM 파서를 이용하는 방식과 SAX 파서를 이용하는 방식의 성능테스트 결과의 일례를 나타내고 있다. Table 1 below shows an example of the performance test results using the DOM parser and the SAX parser.

SAX 방식SAX method DOM 방식DOM method 성능Performance 요구 메모리Demand memory 3배Three times 8배8 times 속도speed 1초1 second 1.4초1.4 seconds 안정성stability 스레드 안전Thread Safety YesYes YesYes 메모리 누수Memory leak NoNo NoNo OOMOOM YesYes YesYes 스택 오버플로우Stack overflow NoNo YesYes

표 1에서 '요구 메모리'는, SAX 방식과 DOM 방식이 자바 환경에서 입력 HTML 코드의 용량 대비 각각 3배와 8배의 메모리를 요구하는 예를 나타내고 있다. '속도'는, 6 메가바이트 용량의 HTML 코드를 처리하는데 걸리는 시간의 예를 나타내고 있다. 이때, DOM 방식에서는 코드에서 중첩된 태그의 깊이가 깊어지면, 재귀함수의 호출이 많아져서 속도가 심하게 느려질 수 있다.Table 1 shows an example in which the SAX method and the DOM method require 3 times and 8 times as much memory as the input HTML code in the Java environment, respectively. 'Speed' is an example of the time it takes to process 6 megabytes of HTML code. At this time, in the DOM method, if the depth of the nested tags in the code is deepened, the recursive function calls may increase, and the speed may be seriously slowed down.

또한, 표 1에서 '스레드 안전'은 파서들을 사용함에 있어 멀티 스레드(thread)환경에서 실행이 안전한가를, '메모리 누수'는 파서에 메모리 누수 버그가 존재하는지 여부를 각각 나타내고 있다.Also, in Table 1, 'thread safe' indicates whether execution is safe in a multi-thread environment in using the parsers, and 'memory leak' indicates whether a memory leak bug exists in the parser.

또한, 표 1에서 'OOM'은 OOM 오류가 발생 가능한가를 나타내고 있다. 이때, DOM 파서와 SAX 파서는 모두 OOM 오류가 발생할 가능성이 존재한다. 그러나, DOM 파서를 이용하는 경우에는 1024 메가바이트 가용메모리 상황에서 9명의 사용자가 동시에 6 메가바이트 용량의 HTML 코드의 필터링을 요청하는 경우, OOM 오류가 발생 가능한 반면, SAX 파서를 이용하는 경우에는 동일한 가용메모리 상황에서 22명의 사용자가 동시에 6 메가바이트 용량의 HTML 코드의 필터링을 요청하는 경우에 OOM 오류가 발생 가능하다. 즉, DOM 파서를 이용하는 경우보다 SAX 파서를 이용하는 경우, OOM 오류가 발생할 가능성이 상대적으로 매우 감소함을 알 수 있다.In Table 1, 'OOM' indicates whether an OOM error can occur. At this time, both the DOM parser and the SAX parser are likely to cause OOM errors. However, when the DOM parser uses 1024 megabytes of available memory, 9 users can simultaneously request 6-megabytes of HTML code to be filtered. However, when using the SAX parser, the same available memory OOM errors can occur if 22 users simultaneously request filtering of 6 megabytes of HTML code. That is, the possibility of OOM error is relatively reduced when the SAX parser is used rather than using the DOM parser.

또한, 표 1에서 "스택 오버플로우"는 스택 오버플로우 오류가 발생하는지 여부를 나타내고 있다. 이미 설명한 바와 같이 DOM 파서를 이용하는 방식에서는 코드의 전체 태그를 파싱해서 태그트리를 제공한다. 이때, 태그의 깊이가 깊을 경우 많은 수의 재귀함수가 호출되어 스택 오버플로우 오류가 발생할 가능성이 존재하는 반면, SAX 파서를 이용하는 방식에서는 태그 하나하나를 순차적으로 파싱해서 각각 제공하기 때문에 근본적으로 스택 오버플로우 오류가 발생하지 않는다.Also, in Table 1, "stack overflow" indicates whether or not a stack overflow error occurs. As we've already seen, the DOM parser approach provides a tag tree by parsing the entire tag of the code. In this case, when the depth of the tag is large, a large number of recursive functions are called to cause a stack overflow error. On the other hand, in the method using the SAX parser, each tag is sequentially parsed and provided, No flow error occurs.

본 발명의 일시예들에 따른 파서들(DOM 파서 및 SAX 파서)은 EBNF(Extended Backus-Naur Form) 표기법(notation)을 기반으로 재정의된 파싱 규칙을 사용할 수도 있다. EBNF 표기법은 XML 1.0 스펙에 정의된 표기법으로, 파서가 비 정형화된 코드를 파싱할 수 있도록 파싱 규칙을 재정의하기 위해 이용될 수 있다. EBNF(Extended Backus-Naur Form) 표기법을 이용함으로써, 특정 브라우저에만 적용되는 코드(일례로, CSS 핵(Counter-Strike Source hack))와 같이 특수한 형태의 태그가 포함된 코드에 대해서도 파싱 규칙에 규칙을 추가하는 간단한 방식을 통해 쉽게 인식될 수 있다.Parsers (DOM parser and SAX parser) according to temporal examples of the present invention may use parsing rules redefined based on Extended Backus-Naur Form (EBNF) notation. EBNF notation is a notation defined in the XML 1.0 specification that can be used to redefine parsing rules so that the parser can parse non-canonicalized code. By using the Extended Backus-Naur Form (EBNF) notation, you can add rules to the parsing rules for code that contains special types of tags, such as code that applies only to a particular browser (for example, Counter-Strike Source hack) It can be easily recognized by a simple way of adding.

또한, 본 발명의 일실시예에 따른 필터링 시스템은 엘리먼트 리스너(element listener)나 어트리뷰트 리스너(attribute listener)를 제공할 수 있다. 일례로, 악의적인 XSS 코드를 변환/삭제하는 기능 이외에 특정 요소에 하위 요소를 추가하거나 또는 데이터를 변경할 수 있도록 이벤트 처리 인터페이스를 제공할 수 있다.In addition, the filtering system according to an exemplary embodiment of the present invention may provide an element listener or an attribute listener. For example, in addition to converting / removing malicious XSS code, you can provide an event handling interface to add sub-elements to specific elements or change data.

또한, 본 발명의 일실시예에 따른 필터링 시스템은 검출된 XSS 코드를 로그수집시스템으로 전송하는 기능을 제공할 수 있다. 예를 들어, 실제 서비스로 유입되는 사용자 입력 중 필터링 과정에서 검출되는 XSS 코드에 대한 로그를 전사로그수집시스템으로 전송하고, 전사로그수집시스템에서 XSS 필터 로그를 관리할 수 있다. 수집된 XSS 필터 로그는 향후 보안대책을 위해 활용될 수 있다. 이때, 검출된 XSS 코드를 전사로그수집시스템으로 전송하는 기능은 본 실시예에 따른 필터링 시스템을 이용하는 기존 서비스의 동의 하에 설정 기반으로 동작여부가 결정될 수 있다.In addition, the filtering system according to an embodiment of the present invention can provide a function of transmitting the detected XSS code to the log collection system. For example, a log of the XSS code detected in the filtering process during the user input to the actual service can be transmitted to the enterprise log collection system, and the XSS filter log can be managed in the enterprise log collection system. The collected XSS filter log can be utilized for future security measures. At this time, the function of transmitting the detected XSS code to the enterprise log collection system can be determined based on the setting based on the agreement of the existing service using the filtering system according to the present embodiment.

또한, 본 발명의 일실시예에 따르면, 도 2 내지 도 4를 통해 설명한 방법들은, 필터링 시스템(또는 적어도 하나의 프로세서와 적어도 하나의 메모리를 포함하는 컴퓨터 시스템)에 설치된 라이브러리에서 해당 방법들의 단계들을 수행하도록 상기 필터링 시스템(또는 상기 컴퓨터 시스템)을 제어함으로써, 수행될 수도 있다. 예를 들어, 상기 라이브러리는 상기 방법들의 단계들을 상기 필터링 시스템(또는 상기 컴퓨터 시스템)이 수행하도록 제어하는 모듈들을 포함할 수 있다. 이 경우, 상기 라이브러리는 상기 라이브러리의 설치를 위한 파일을 배포하는 파일 배포 시스템에 의해 상기 필터링 시스템(또는 상기 컴퓨터 시스템)으로 전송되어 설치될 수 있다.Further, according to one embodiment of the present invention, the methods described with reference to FIGS. 2 through 4 can be implemented in a library installed in a filtering system (or a computer system including at least one processor and at least one memory) Or by controlling the filtering system (or the computer system) to perform the filtering. For example, the library may include modules for controlling the filtering system (or the computer system) to perform the steps of the methods. In this case, the library may be transmitted to the filtering system (or the computer system) and installed by a file distribution system that distributes a file for installation of the library.

도 5는 본 발명의 일실시예에 있어서, 컴퓨터 시스템 및 파일 제공 시스템을 도시한 블록도이고, 도 6은 본 발명의 일실시예에 있어서, 필터링 방법을 도시한 흐름도이다. 도 5는 컴퓨터 시스템(510), 라이브러리(520) 및 라이브러리 제공 시스템(530)을 도시하고 있다. 컴퓨터 시스템(510)은 적어도 하나의 프로세서(미도시)와 적어도 하나의 메모리(미도시)를 포함할 수 있으며, 라이브러리 제공 시스템(530)은 라이브러리의 설치를 위한 파일을 클라이언트 시스템으로 제공하는 파일 제공부(531)를 포함할 수 있다. 이 경우에는 컴퓨터 시스템(510)이 상기 클라이언트 시스템에 대응될 수 있다.FIG. 5 is a block diagram illustrating a computer system and a file providing system in an embodiment of the present invention, and FIG. 6 is a flowchart illustrating a filtering method in an embodiment of the present invention. Figure 5 shows a computer system 510, a library 520, and a library providing system 530. The computer system 510 may include at least one processor (not shown) and at least one memory (not shown), and the library providing system 530 may include a file providing a file for installation of the library to the client system (531). In this case, the computer system 510 may correspond to the client system.

또한, 본 실시예에 따른 필터링 방법은 도 5에 도시된 컴퓨터 시스템(510)에 의해 수행될 수 있다. 일례로, 필터링 방법은 라이브러리 제공 시스템(530)이 제공하는 라이브러리(520)가 설치된 컴퓨터 시스템(510)의 적어도 하나의 프로세서에 의해, 라이브러리(520)의 제어에 따라 수행될 수 있다.In addition, the filtering method according to the present embodiment can be performed by the computer system 510 shown in Fig. The filtering method may be performed under the control of the library 520 by at least one processor of the computer system 510 in which the library 520 provided by the library providing system 530 is installed.

단계(610)에서 컴퓨터 시스템(510)은 현재 사용 가능한 메모리 용량을 확인할 수 있다. 일례로, 컴퓨터 시스템(510)은 컴퓨터 시스템(510)에 포함된 적어도 하나의 메모리에 대해, 현재 사용 가능한 메모리 용량을 확인할 수 있다.At step 610, the computer system 510 may determine the currently available memory capacity. In one example, the computer system 510 can determine the currently available memory capacity for at least one memory included in the computer system 510.

단계(620)에서 컴퓨터 시스템(510)은 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산할 수 있다. 여기서, 제1 파서는 코드에 포함된 전체 태그에 대한 트리를 파싱 결과로서 생성하여 제공하는 파서를 포함할 수 있다. 일례로, 이미 설명한 DOM 파서가 제1 파서로서 이용될 수 있다.In step 620, the computer system 510 may calculate the expected memory usage when parsing the code through the first parser by checking the capacity of the code. Here, the first parser may include a parser generating and providing a tree of the entire tag included in the code as a parsing result. As an example, the DOM parser already described can be used as the first parser.

단계(630)에서 컴퓨터 시스템(510)은 메모리 용량 및 메모리 사용량에 기초하여 제1 파서 및 제2 파서 중 하나의 파서를 선택할 수 있다. 여기서, 제2 파서는 코드에 포함된 태그들을 파싱 결과로서 순차적으로 제공하는 파서를 포함할 수 있다. 일례로, 이미 설명한 SAX 파서가 제2 파서로 이용될 수 있다.At step 630, the computer system 510 may select a parser of either the first parser or the second parser based on memory capacity and memory usage. Here, the second parser may include a parser that sequentially provides the tags included in the code as a parsing result. For example, the SAX parser already described can be used as the second parser.

하나의 파서를 선택하기 위한 예로, 컴퓨터 시스템(510)은 메모리 용량 및 메모리 사용량에 기초하여OOM(Out Of Memory) 오류가 발생하는지 여부를 판단하고, 판단 결과에 따라 하나의 파서를 결정할 수 있다. 이를 위해, 단계(630)는 메모리 용량 및 메모리 사용량을 비교하여 제1 파서(parser)를 이용한 파싱을 통해 OOM(Out Of Memory) 오류가 발생하는지 여부를 판단하는 단계(미도시) 및 OOM 오류가 발생하지 않는 경우에 제1 파서를 선택하고, OOM 오류가 발생하는 경우에 제2 파서를 선택하는 단계(미도시)를 포함할 수 있다.As an example of selecting one parser, the computer system 510 may determine whether an Out Of Memory (OOM) error has occurred based on memory capacity and memory usage, and may determine one parser according to the determination result. For this, step 630 compares the memory capacity and the memory usage to determine whether an Out Of Memory (OOM) error occurs through parsing using a first parser (not shown) and an OOM error (Not shown) to select the first parser if no OOM error occurs, and to select the second parser if OOM error occurs.

하나의 파서를 선택하기 위한 다른 예로, 컴퓨터 시스템(510)은 단계(630)에서 메모리 용량이 메모리 사용량보다 기설정된 용량 이상 큰 경우, 제1 파서를 선택하고, 메모리 용량이 메모리 사용량보다 상기 기설정된 용량 이상 크지 않은 경우, 제2 파서를 선택할 수 있다.As another example for selecting one parser, in step 630, the computer system 510 selects the first parser if the memory capacity is greater than the memory usage by more than a predetermined amount, and if the memory capacity exceeds the memory usage If it is not greater than the capacity, the second parser can be selected.

단계(640)에서 컴퓨터 시스템(510)은 선택된 파서를 통해 코드의 파싱을 진행하여 파싱 결과를 생성할 수 있다. 이미 설명한 바와 같이, 제1 파서는 코드에 포함된 전체 태그에 대한 트리를 상기 파싱 결과로서 생성하여 제공할 수 있고, 제2 파서는 코드에 포함된 태그들을 상기 파싱 결과로서 순차적으로 제공할 수 있다.At step 640, the computer system 510 may proceed to parse the code through the selected parser to produce a parsing result. As described above, the first parser can generate and provide a tree for the entire tag included in the code as the parsing result, and the second parser can sequentially provide the tags included in the code as the parsing result .

이때, 제1 파서를 이용하여 파싱 결과가 생성되는 경우, 컴퓨터 시스템(510)은 스택 오버플로우 오류의 발생 여부를 판단하여 제1 파서를 제2 파서로 전환할 수 있고, 전환된 제2 파서를 통해 코드의 파싱을 재수행할 수 있다. 이를 위해, 단계(640)은 제1 파서가 하나의 파서로 선택된 경우, 제1 파서를 이용하여 코드의 파싱을 진행하면서, 스택 오버플로우 오류의 발생 여부를 모니터링하는 단계(미도시) 및 스택 오버플로우 오류의 발생이 감지되는 경우, 선택된 제1 파서를 제2 파서로 전환하여 제2 파서를 통해 코드의 파싱을 재수행하여 파싱 결과를 생성하는 단계(미도시)를 포함할 수 있다.At this time, if a parsing result is generated using the first parser, the computer system 510 may determine whether a stack overflow error has occurred, convert the first parser to a second parser, You can re-execute the parsing of the code. For this purpose, step 640 includes steps (not shown) for monitoring the occurrence of a stack overflow error while parsing the code using the first parser, if the first parser is selected as one parser, When the occurrence of the flow error is detected, the step of converting the selected first parser into the second parser to re-execute the parsing of the code through the second parser to generate a parsing result (not shown).

단계(650)에서 컴퓨터 시스템(510)은 생성된 파싱 결과를 이용하여 코드의 필터링을 수행할 수 있다. 예를 들어, 컴퓨터 시스템(510)은 파싱 결과와 화이트리스트 설정을 비교하여 파싱 결과에 포함된 코드(또는 태그)들 중 화이트리스트 설정을 통해 허용된 코드(또는 태그)들을 제외한 나머지 코드(또는 태그)들을 변경 또는 삭제하여 코드에 대한 필터링을 수행할 수 있다. 여기서, 화이트리스트 설정은, 화이트리스트 상위 설정 파일의 필터링 규칙이 화이트리스트 하위 설정 파일로 상속 또는 오버라이딩되도록 구현될 수 있다.At step 650, the computer system 510 may perform filtering of the code using the generated parsing result. For example, the computer system 510 compares the parsing result with the whitelist setting, and determines whether the remaining code (or tags (or tags) other than the permitted code (or tags) ) Can be changed or deleted to perform filtering on the code. Here, the whitelist setting may be implemented such that the filtering rule of the whitelist upper setting file is inherited or overridden as the whitelist lower setting file.

도 5 및 도 6에서 생략된 내용은 도 1 내지 도 4를 참조할 수 있다.The contents omitted in Figs. 5 and 6 can be referred to Fig. 1 to Fig.

이와 같이, 본 발명의 실시예들에 따르면, 사용 가능한 메모리 용량과 필터링 대상 코드의 용량을 비교하여 DOM(document Object Model) 마크업 파서(markup parser)와 SAX(Simple API for XML) 마크업 파서 중 하나를 선택적으로 활용할 수 있다. 또한, DOM 마크업 파서를 이용한 파싱을 통해, 스택 오버플로우(stack overflow) 오류의 발생이 감지되는 경우, DOM 마크업 파서를 스택 오버플로우 오류가 원적적으로 발생하지 않는 SAX 마크업 파서로 자동 전환하여 파싱을 수행할 수 있다. 또한, 블랙리스트 필터링 방식이 아닌 화이트리스트 필터링 방식을 활용하여 일관된 XSS 보안 정책을 수립 및 적용할 수 있다.As described above, according to embodiments of the present invention, by comparing a usable memory capacity with a capacity of a filtering target code, a markup parser (DOM) and a simple API for XML (SAX) markup parser One can be selectively used. In addition, parsing using the DOM markup parser automatically switches the DOM markup parser to a SAX markup parser where stack overflow errors do not occur naturally when a stack overflow error is detected. To perform parsing. In addition, a consistent XSS security policy can be established and applied using the whitelist filtering method instead of the blacklist filtering method.

이상에서 설명된 장치는 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPA(field programmable array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The apparatus described above may be implemented as a hardware component, a software component, and / or a combination of hardware components and software components. For example, the apparatus and components described in the embodiments may be implemented within a computer system, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable array (FPA) A programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to execution of the software. For ease of understanding, the processing apparatus may be described as being used singly, but those skilled in the art will recognize that the processing apparatus may have a plurality of processing elements and / As shown in FIG. For example, the processing unit may comprise a plurality of processors or one processor and one controller. Other processing configurations are also possible, such as a parallel processor.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.The software may include a computer program, code, instructions, or a combination of one or more of the foregoing, and may be configured to configure the processing device to operate as desired or to process it collectively or collectively Device can be commanded. The software and / or data may be in the form of any type of machine, component, physical device, virtual equipment, computer storage media, or device , Or may be permanently or temporarily embodied in a transmitted signal wave. The software may be distributed over a networked computer system and stored or executed in a distributed manner. The software and data may be stored on one or more computer readable recording media.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI > or equivalents, even if it is replaced or replaced.

그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

100: 필터링 시스템
110: 필터 객체
110: 필터 코어
120: 설정 빌더
130: 파서
100: Filtering system
110: Filter object
110: filter core
120: Setup builder
130: Parser

Claims (17)

코드를 필터링하는 필터링 방법에 있어서,
현재 사용 가능한 메모리 용량을 확인하는 단계;
상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하는 단계;
상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하는 단계;
상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하는 단계; 및
상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하는 단계
를 포함하는 필터링 방법.
A method of filtering a code, the method comprising:
Checking the currently available memory capacity;
Checking the capacity of the code and calculating an expected amount of memory usage when parsing is performed through a first parser;
Selecting one of the first parser and the second parser based on the memory capacity and the memory usage;
Proceeding with parsing the code through the selected parser to produce a parsing result; And
Performing filtering of the code using the generated parsing result
/ RTI >
제1항에 있어서,
상기 제1 파서는, 상기 코드에 포함된 전체 태그에 대한 트리를 상기 파싱 결과로서 생성하여 제공하는 파서를 포함하고,
상기 제2 파서는 상기 코드에 포함된 태그들을 상기 파싱 결과로서 순차적으로 제공하는 파서를 포함하는 것을 특징으로 하는 필터링 방법.
The method according to claim 1,
Wherein the first parser includes a parser that generates and provides a tree for the entire tag included in the code as the parsing result,
Wherein the second parser includes a parser for sequentially providing the tags included in the code as the parsing result.
제2항에 있어서,
상기 하나의 파서를 선택하는 단계는,
상기 메모리 용량 및 상기 메모리 사용량을 비교하여 상기 제1 파서(parser)를 이용한 파싱을 통해 OOM(Out Of Memory) 오류가 발생하는지 여부를 판단하는 단계; 및
상기 OOM 오류가 발생하지 않는 경우에 상기 제1 파서를 선택하고, 상기 OOM 오류가 발생하는 경우에 상기 제2 파서를 선택하는 단계
를 포함하는 것을 특징으로 하는 필터링 방법.
3. The method of claim 2,
Wherein the step of selecting one parser comprises:
Comparing the memory capacity and the amount of memory usage and determining whether an Out Of Memory (OOM) error occurs through parsing using the first parser; And
Selecting the first parser if the OOM error does not occur, and selecting the second parser if the OOM error occurs
And filtering the received signal.
제2항에 있어서,
상기 하나의 파서를 선택하는 단계는,
상기 메모리 용량이 상기 메모리 사용량보다 기설정된 용량 이상 큰 경우, 상기 제1 파서를 선택하고, 상기 메모리 용량이 상기 메모리 사용량보다 상기 기설정된 용량 이상 크지 않은 경우, 상기 제2 파서를 선택하는 것을 특징으로 하는 필터링 방법.
3. The method of claim 2,
Wherein the step of selecting one parser comprises:
And selects the first parser when the memory capacity is larger than the memory capacity by a predetermined capacity or more and selects the second parser when the memory capacity is not larger than the memory capacity by the preset capacity or more. Lt; / RTI >
제2항에 있어서,
상기 파싱 결과를 생성하는 단계는,
상기 제1 파서가 상기 하나의 파서로 선택된 경우, 상기 제1 파서를 이용하여 상기 코드의 파싱을 진행하면서, 스택 오버플로우(stack overflow) 오류의 발생 여부를 모니터링하는 단계; 및
상기 스택 오버플로우 오류의 발생이 감지되는 경우, 상기 선택된 제1 파서를 상기 제2 파서로 전환하여 상기 제2 파서를 통해 상기 코드의 파싱을 재수행하여 상기 파싱 결과를 생성하는 단계
를 포함하는 것을 특징으로 하는 필터링 방법.
3. The method of claim 2,
Wherein generating the parsing result comprises:
Monitoring the occurrence of a stack overflow error while parsing the code using the first parser if the first parser is selected as the one parser; And
If the occurrence of the stack overflow error is detected, converting the selected first parser to the second parser and re-parsing the code through the second parser to generate the parsing result
And filtering the received signal.
제1항에 있어서,
상기 코드의 필터링을 수행하는 단계는,
상기 파싱 결과와 화이트리스트 설정을 비교하여 상기 파싱 결과에 포함된 코드(또는 태그)들 중 상기 화이트리스트 설정을 통해 허용된 코드(또는 태그)들을 제외한 나머지 코드(또는 태그)들을 변경 또는 삭제하여 상기 코드에 대한 필터링을 수행하는 것을 특징으로 하는 필터링 방법.
The method according to claim 1,
Wherein performing the filtering of the code comprises:
(Or tags) other than the code (or tags) allowed through the whitelist setting among the codes (or tags) included in the parsing result by comparing the parsing result and the white list setting, Wherein the filtering is performed on the code.
제6항에 있어서,
상기 화이트리스트 설정은, 화이트리스트 상위 설정 파일의 필터링 규칙이 화이트리스트 하위 설정 파일로 상속 또는 오버라이딩되도록 구현되는 것을 특징으로 하는 필터링 방법.
The method according to claim 6,
Wherein the white list setting is implemented such that the filtering rule of the white list upper configuration file is inherited or overridden as the white list lower configuration file.
제1항 내지 제7항 중 어느 한 항의 방법을 수행하는 프로그램을 기록한 컴퓨터 판독 가능 기록 매체.A computer-readable recording medium recording a program for performing the method of any one of claims 1 to 7. 코드를 필터링하는 필터링 시스템에 있어서,
적어도 하나의 프로세서; 및
적어도 하나의 메모리
를 포함하고,
상기 적어도 하나의 프로세서는,
상기 적어도 하나의 메모리에 대해, 현재 사용 가능한 메모리 용량을 확인하고,
상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하고,
상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하고,
상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하고,
상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하는
것을 특징으로 하는 필터링 시스템.
A filtering system for filtering code,
At least one processor; And
At least one memory
Lt; / RTI >
Wherein the at least one processor comprises:
Determining, for the at least one memory, a currently available memory capacity,
The capacity of the code is checked and an expected memory use amount is calculated when parsing is performed through the first parser,
Selecting one of the first parser and the second parser based on the memory capacity and the memory usage,
Parsing the code through the selected parser to generate a parsing result,
And the filtering of the code is performed using the generated parsing result
The filtering system comprising:
제9항에 있어서,
상기 제1 파서는, 상기 코드에 포함된 전체 태그에 대한 트리를 상기 파싱 결과로서 생성하여 제공하는 파서를 포함하고,
상기 제2 파서는 상기 코드에 포함된 태그들을 상기 파싱 결과로서 순차적으로 제공하는 파서를 포함하는 것을 특징으로 하는 필터링 시스템.
10. The method of claim 9,
Wherein the first parser includes a parser that generates and provides a tree for the entire tag included in the code as the parsing result,
Wherein the second parser includes a parser that sequentially provides the tags included in the code as the parsing result.
제10항에 있어서,
상기 적어도 하나의 프로세서는, 상기 하나의 파서를 선택하기 위해,
상기 메모리 용량 및 상기 메모리 사용량을 비교하여 상기 제1 파서(parser)를 이용한 파싱을 통해 OOM(Out Of Memory) 오류가 발생하는지 여부를 판단하고,
상기 OOM 오류가 발생하지 않는 경우에 상기 제1 파서를 선택하고, 상기 OOM 오류가 발생하는 경우에 상기 제2 파서를 선택하는
것을 특징으로 하는 필터링 시스템.
11. The method of claim 10,
Wherein the at least one processor is further adapted to:
Compares the memory capacity with the memory usage, determines whether an OOM (Out Of Memory) error occurs through parsing using the first parser,
Selects the first parser if the OOM error does not occur, and selects the second parser if the OOM error occurs
The filtering system comprising:
제10항에 있어서,
상기 적어도 하나의 프로세서는, 상기 하나의 파서를 선택하기 위해,
상기 메모리 용량이 상기 메모리 사용량보다 기설정된 용량 이상 큰 경우, 상기 제1 파서를 선택하고, 상기 메모리 용량이 상기 메모리 사용량보다 상기 기설정된 용량 이상 크지 않은 경우, 상기 제2 파서를 선택하는
것을 특징으로 하는 필터링 시스템.
11. The method of claim 10,
Wherein the at least one processor is further adapted to:
Selects the first parser when the memory capacity is larger than the memory capacity by a predetermined capacity or more and selects the second parser when the memory capacity is not greater than the predetermined capacity by more than the predetermined capacity
The filtering system comprising:
제10항에 있어서,
상기 적어도 하나의 프로세서는, 상기 파싱 결과를 생성하기 위해,
상기 제1 파서가 상기 하나의 파서로 선택된 경우, 상기 제1 파서를 이용하여 상기 코드의 파싱을 진행하면서, 스택 오버플로우(stack overflow) 오류의 발생 여부를 모니터링하고,
상기 스택 오버플로우 오류의 발생이 감지되는 경우, 상기 선택된 제1 파서를 상기 제2 파서로 전환하여 상기 제2 파서를 통해 상기 코드의 파싱을 재수행하여 상기 파싱 결과를 생성하는
것을 특징으로 하는 필터링 방법.
11. The method of claim 10,
Wherein the at least one processor is configured to:
Wherein if the first parser is selected as the one parser, parsing of the code is performed using the first parser to monitor whether a stack overflow error has occurred,
When the occurrence of the stack overflow error is detected, converting the selected first parser to the second parser and re-parsing the code through the second parser to generate the parsing result
.
제9항에 있어서,
상기 적어도 하나의 프로세서는, 상기 코드의 필터링을 수행하기 위해,
상기 파싱 결과와 화이트리스트 설정을 비교하여 상기 파싱 결과에 포함된 코드(또는 태그)들 중 상기 화이트리스트 설정을 통해 허용된 코드(또는 태그)들을 제외한 나머지 코드(또는 태그)들을 변경 또는 삭제하여 상기 코드에 대한 필터링을 수행하는
것을 특징으로 하는 필터링 방법.
10. The method of claim 9,
Wherein the at least one processor is further configured to:
(Or tags) other than the code (or tags) allowed through the whitelist setting among the codes (or tags) included in the parsing result by comparing the parsing result and the white list setting, To perform filtering on your code
.
제14항에 있어서,
상기 화이트리스트 설정은, 화이트리스트 상위 설정 파일의 필터링 규칙이 화이트리스트 하위 설정 파일로 상속 또는 오버라이딩되도록 구현되는 것을 특징으로 하는 필터링 방법.
15. The method of claim 14,
Wherein the white list setting is implemented such that the filtering rule of the white list upper configuration file is inherited or overridden as the white list lower configuration file.
코드를 필터링하기 위한 라이브러리를 제공하는 라이브러리 제공 시스템에 있어서,
상기 라이브러리의 설치를 위한 파일을 클라이언트 시스템으로 제공하는 파일 제공부
를 포함하고,
상기 라이브러리는,
적어도 하나의 메모리에 대해, 현재 사용 가능한 메모리 용량을 확인하도록 상기 클라이언트 시스템을 제어하는 모듈;
상기 코드의 용량을 확인하여 제1 파서(parser)를 통해 파싱(parsing)을 진행하는 경우에 예상되는 메모리 사용량을 계산하도록 상기 클라이언트 시스템을 제어하는 모듈;
상기 메모리 용량 및 상기 메모리 사용량에 기초하여 상기 제1 파서 및 제2 파서 중 하나의 파서를 선택하도록 상기 클라이언트 시스템을 제어하는 모듈;
상기 선택된 파서를 통해 상기 코드의 파싱을 진행하여 파싱 결과를 생성하도록 상기 클라이언트 시스템을 제어하는 모듈; 및
상기 생성된 파싱 결과를 이용하여 상기 코드의 필터링을 수행하도록 상기 클라이언트 시스템을 제어하는 모듈
을 포함하는 것을 특징으로 하는 라이브러리 제공 시스템.
A library providing system for providing a library for filtering codes,
A file providing unit for providing a file for installing the library to a client system,
Lt; / RTI >
The library includes:
A module for controlling the client system to determine a currently available memory capacity for at least one memory;
A module for checking the capacity of the code and controlling the client system to calculate an expected amount of memory usage when parsing is performed through a first parser;
A module for controlling the client system to select a parser of one of the first parser and the second parser based on the memory capacity and the memory usage;
A module for controlling the client system to proceed with parsing of the code through the selected parser to generate a parsing result; And
A module for controlling the client system to perform filtering of the code using the generated parsing result;
The library providing system comprising:
제16항에 있어서,
상기 제1 파서는, 상기 코드에 포함된 전체 태그에 대한 트리를 상기 파싱 결과로서 생성하여 제공하는 파서를 포함하고,
상기 제2 파서는 상기 코드에 포함된 태그들을 상기 파싱 결과로서 순차적으로 제공하는 파서를 포함하는 것을 특징으로 하는 라이브러리 제공 시스템.
17. The method of claim 16,
Wherein the first parser includes a parser that generates and provides a tree for the entire tag included in the code as the parsing result,
Wherein the second parser includes a parser for sequentially providing the tags included in the code as the parsing result.
KR1020130007863A 2013-01-24 2013-01-24 Filtering method and system for satisfying both security and performance KR101539139B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020130007863A KR101539139B1 (en) 2013-01-24 2013-01-24 Filtering method and system for satisfying both security and performance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020130007863A KR101539139B1 (en) 2013-01-24 2013-01-24 Filtering method and system for satisfying both security and performance

Publications (2)

Publication Number Publication Date
KR20140095217A KR20140095217A (en) 2014-08-01
KR101539139B1 true KR101539139B1 (en) 2015-07-23

Family

ID=51743711

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020130007863A KR101539139B1 (en) 2013-01-24 2013-01-24 Filtering method and system for satisfying both security and performance

Country Status (1)

Country Link
KR (1) KR101539139B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360454B (en) * 2021-06-30 2024-03-01 广州虎牙科技有限公司 Memory snapshot file compression and decompression method and related device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110108491A (en) * 2010-03-29 2011-10-06 한국전자통신연구원 System for detecting malicious script and method for detecting malicious script using the same

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110108491A (en) * 2010-03-29 2011-10-06 한국전자통신연구원 System for detecting malicious script and method for detecting malicious script using the same

Also Published As

Publication number Publication date
KR20140095217A (en) 2014-08-01

Similar Documents

Publication Publication Date Title
US9027075B2 (en) Enforcing security rules at runtime
KR101514984B1 (en) Detecting system for detecting Homepage spreading Virus and Detecting method thereof
US20150379272A1 (en) Method, system, and computer program product for automatically mitigating vulnerabilities in source code
WO2016164036A1 (en) Modifying web page code to include code to protect output
Patil et al. Towards fine-grained access control in javascript contexts
US9940464B2 (en) Static security analysis using a hybrid representation of string values
Luo et al. Time does not heal all wounds: A longitudinal analysis of security-mechanism support in mobile browsers
KR102502181B1 (en) Rights control method and device, computer device and storage medium
KR102015108B1 (en) Method and user device and web server for providing using cache into browser among heterogeneous service
EP2570960A2 (en) Method of controlling information processing system, program for controlling apparatus
CN104468546A (en) Network information processing method and firewall device and system
EP3260976A1 (en) System and method of generating a secured communication layer
US8484232B2 (en) Method, computer arrangement, computer program and computer program product for checking for the presence of control statements in a data value
KR101539139B1 (en) Filtering method and system for satisfying both security and performance
CN113779578A (en) Intelligent confusion method and system for mobile terminal application
CN104239514A (en) Webpage rendering method, device and mobile terminal
KR20140068940A (en) Content handling for applications
CN104598812B (en) Web-page approach and device are browsed in sandbox
KR101800280B1 (en) Method for executing security page and terminal performing the method
KR102157208B1 (en) Smart contract excution apparatus and vulnerability detection method
JP5665984B2 (en) Client device, recording medium for causing web data authority management method to be executed by computer, authority management information providing apparatus and method thereof
Mao et al. Automatic permission inference for hybrid mobile apps
Zhang et al. File Guard: automatic format-based media file sanitization: A black-box approach against vulnerability exploitation
CN117131515B (en) Application request execution method and device, computer equipment and storage medium
US20230362198A1 (en) Dynamic security policy enforcement method for container system, recording medium and system for performing the same

Legal Events

Date Code Title Description
A201 Request for examination
N231 Notification of change of applicant
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20190701

Year of fee payment: 5