mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
XMPMeta.registerNamespace and packets that declare namespaces could add up to 4,096 namespaces of any length, held outside the script heap. - A namespace URI over 1,024 bytes and a prefix over 128 bytes, the `_n_` suffix included, throw "the XMP data is too large". - The registered namespaces hold at most 1 MiB together; a namespace past that throws the same error and is not registered. - Reading a packet takes fuel for the namespaces it copies. - Error messages hold at most the first 200 characters of a name, path, value or namespace the script gave. Tests: namespace_lengths_and_the_registry_budget_are_bounded, long_namespaces_from_scripts_and_packets_are_refused and error_messages_hold_a_bounded_part_of_the_script_text in crates/js/src/xmp_tests.rs. Docs: docs/mcp.md.