使用来自多个解析器的错误消息查找不兼容的文档
Looking for non-compliant documents using error messages from multiple parsers
摘要:
文件是否被单个解析器接受并不能可靠地指示文件是否符合其声明的格式。解析器和格式规范中的bug意味着兼容的文件可能无法解析,或者不兼容的文件可能被读取而没有任何明显的麻烦。后一种情况构成重大的安全风险,应予以避免。本文建议,评估格式规范遵从性的更好方法是检查由一组解析器而不是单个解析器产生的一组错误消息。如果一个样本的兼容文件和一个样本的不兼容的文件是可用的,那么我们展示了如何基于伪似然比的统计测试可以非常有效地确定文件的合规性。我们的方法是格式不可知的,并且不直接依赖于格式的正式规范。尽管本文主要关注PDF格式(ISO 32000 - 2)的情况,但我们并不打算使用该格式的任何特定细节。此外,我们展示了如何主成分分析可以是有用的格式规范设计师,以评估这些样本的文件和解析器的质量和结构。虽然这些测试是绝对基本的,但似乎它们用于测量文件格式的变化和识别不兼容的文件既新颖又令人惊讶地有效。
英文摘要:
Whether a file is accepted by a single parser is not a reliable indication of whether a file complies with its stated format. Bugs within both the parser and the format specification mean that a compliant file may fail to parse, or that a non-compliant file might be read without any apparent trouble. The latter situation presents a significant security risk, and should be avoided. This article suggests that a better way to assess format specification compliance is to examine the set of error messages produced by a set of parsers rather than a single parser. If both a sample of compliant files and a sample of non-compliant files are available, then we show how a statistical test based on a pseudo-likelihood ratio can be very effective at determining a file's compliance. Our method is format agnostic, and does not directly rely upon a formal specification of the format. Although this article focuses upon the case of the PDF format (ISO 32000-2), we make no attempt to use any specific details of the format. Furthermore, we show how principal components analysis can be useful for a format specification designer to assess the quality and structure of these samples of files and parsers. While these tests are absolutely rudimentary, it appears that their use to measure file format variability and to identify non-compliant files is both novel and surprisingly effective.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。