WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Security Vulnerability - Action Required: Uncontrolled Resource Consumption vulnerability may in your project #5

@Crispy-fried-chicken

Description

@Crispy-fried-chicken

Hi,
We have detected that your project of the newest version may have the Uncontrolled Resource Consumption vulnerability in the function scanPI in the file src/org/cyberneko/html/HTMLScanner.java.
This function includes several functions related to parsing HTML/XML, such as scanPI, scanEntityRef, and scanAttribute. These functions process input from a stream (fCurrentEntity) and build strings using StringBuffer. The main concern for CWE-400 is uncontrolled resource consumption through memory allocation or infinite loops. The functions use loops to read characters until specific delimiters are found (e.g., ';', '>', or quotes), but they include checks for end-of-file (-1) and rewind mechanisms to prevent infinite loops. However, the functions do not impose explicit limits on the size of the input being processed (e.g., the length of attribute values or entity references). For instance, scanEntityRef appends characters to a buffer without a size cap, which could lead to excessive memory allocation if a malicious input provides a very long entity reference without a semicolon. Similarly, scanAttribute processes attribute values in loops without size constraints. While there are no obvious infinite loops due to the EOF checks, the lack of bounds on string growth could result in memory exhaustion when processing large inputs, aligning with CWE-400 patterns like unrestricted data processing.
Would you can help to check if this bug is true? If it's true, I'd like to open a PR for that if necessary. Thank you for your effort and patience!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions