HelloZeroNet/ZeroNet · error · VerifyError

File not allowed

Error message

File not allowed: %s

What it means

VerifyError raised during verifyContentInclude when a file listed in the include's content.json violates the parent's 'files_allowed' filename rules. The input at fault is file_inner_path that does not match the whitelist patterns declared in the signing rules, so the include content cannot be accepted.

Solutions

  1. Remove or rename the offending file so its inner path matches the files_allowed patterns
  2. Update the parent site's rules (files_allowed in content.json) and re-sign if the file is legitimately needed
  3. Catch VerifyError in verifyContent and reject the include with a descriptive message
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/Content/ContentManager.py:915 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HelloZeroNet/ZeroNet@454c0b2e7e (2026-09-02). Data as JSON: /api/errors/90191fd33a2e8872. Report an issue: GitHub.

Appendix: source

Thrown at src/Content/ContentManager.py:915

        if not rules:
            raise VerifyError("No rules")

        # Check include size limit
        if rules.get("max_size") is not None:  # Include size limit
            if content_size > rules["max_size"]:
                raise VerifyError("Include too large %sB > %sB" % (content_size, rules["max_size"]))

        if rules.get("max_size_optional") is not None:  # Include optional files limit
            if content_size_optional > rules["max_size_optional"]:
                raise VerifyError("Include optional files too large %sB > %sB" % (
                    content_size_optional, rules["max_size_optional"])
                )

        # Filename limit
        if rules.get("files_allowed"):
            for file_inner_path in list(content["files"].keys()):
                if not SafeRe.match(r"^%s$" % rules["files_allowed"], file_inner_path):
                    raise VerifyError("File not allowed: %s" % file_inner_path)

        if rules.get("files_allowed_optional"):
            for file_inner_path in list(content.get("files_optional", {}).keys()):
                if not SafeRe.match(r"^%s$" % rules["files_allowed_optional"], file_inner_path):
                    raise VerifyError("Optional file not allowed: %s" % file_inner_path)

        # Check if content includes allowed
        if rules.get("includes_allowed") is False and content.get("includes"):
            raise VerifyError("Includes not allowed")

        return True  # All good

    # Verify file validity
    # Return: None = Same as before, False = Invalid, True = Valid
    def verifyFile(self, inner_path, file, ignore_same=True):
        if inner_path.endswith("content.json"):  # content.json: Check using sign
            from Crypt import CryptBitcoin
            try:

View on GitHub (pinned to 454c0b2e7e)