ladybird/Userland/Libraries/LibJS
Ben Wiederhake 3aeb57ed09 AK+Everywhere: Fix data corruption due to code-point-to-char conversion
In particular, StringView::contains(char) is often used with a u32
code point. When this is done, the compiler will for some reason allow
data corruption to occur silently.

In fact, this is one of two reasons for the following OSS Fuzz issue:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49184
This is probably a very old bug.

In the particular case of URLParser, AK::is_url_code_point got confused:
    return /* ... */ || "!$&'()*+,-./:;=?@_~"sv.contains(code_point);
If code_point is a large code point that happens to have the correct
lower bytes, AK::is_url_code_point is then convinced that the given
code point is okay, even if it is actually problematic.

This commit fixes *only* the silent data corruption due to the erroneous
conversion, and does not fully resolve OSS-Fuzz#49184.
2022-10-09 10:37:20 -06:00
..
Bytecode LibJS: Show class name in the dump from the NewClass instruction 2022-10-02 18:49:17 +01:00
Contrib/Test262 LibJS: Implement $262.evalScript() according to the given algorithm 2022-08-30 12:00:04 +01:00
Heap LibJS: Add Visitor::visit(GCPtr<T>) and Visitor::visit(NonnullGCPtr<T>) 2022-10-02 23:02:27 +01:00
Runtime AK+Everywhere: Fix data corruption due to code-point-to-char conversion 2022-10-09 10:37:20 -06:00
Tests LibJS: Use Unicode normalization within String.prototype.normalize 2022-10-06 22:14:44 +01:00
AST.cpp LibJS: Make PromiseCapability GC-allocated 2022-10-02 23:02:27 +01:00
AST.h LibJS: Allow SpreadExpressions to generate bytecode 2022-10-01 00:04:02 +01:00
CMakeLists.txt LibJS: Move PromiseCapability into its own cpp/h file 2022-10-02 23:02:27 +01:00
Console.cpp LibJS: Create Console using a Realm instead of a VM 2022-09-21 20:03:49 +01:00
Console.h LibJS: Create Console using a Realm instead of a VM 2022-09-21 20:03:49 +01:00
CyclicModule.cpp LibJS: Add [[HostDefined]] field to Modules 2022-10-06 16:41:36 +02:00
CyclicModule.h LibJS: Add accessor for requested modules to CyclicModule 2022-10-06 16:41:36 +02:00
Forward.h LibJS: Make PromiseCapability GC-allocated 2022-10-02 23:02:27 +01:00
Interpreter.cpp LibJS: Make Script and Module GC-allocated 2022-09-06 00:27:09 +02:00
Interpreter.h LibJS: Remove {Bytecode::,}Interpreter::global_object() 2022-08-23 13:58:30 +01:00
Lexer.cpp Everywhere: Use default StringView constructor over nullptr 2022-07-12 23:11:35 +02:00
Lexer.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
MarkupGenerator.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
MarkupGenerator.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Module.cpp LibJS: Add [[HostDefined]] field to Modules 2022-10-06 16:41:36 +02:00
Module.h LibJS: Add [[HostDefined]] field to Modules 2022-10-06 16:41:36 +02:00
Parser.cpp LibJS: Allow anonymous functions as default exports 2022-09-02 02:07:37 +01:00
Parser.h LibJS: Allow anonymous functions as default exports 2022-09-02 02:07:37 +01:00
SafeFunction.h LibJS: Add JS::SafeFunction, like Function but protects captures from GC 2022-09-24 12:23:29 +02:00
Script.cpp LibJS: Make sure JS::Script visits its HostDefined object 2022-09-06 01:21:09 +02:00
Script.h LibJS: Mark [[HostDefined]] accessor on scripts as const 2022-10-06 16:41:36 +02:00
SourceRange.h LibJS: Add missing headers 2021-10-06 23:52:40 +01:00
SourceTextModule.cpp LibJS: Add [[HostDefined]] field to Modules 2022-10-06 16:41:36 +02:00
SourceTextModule.h LibJS: Add [[HostDefined]] field to Modules 2022-10-06 16:41:36 +02:00
SyntaxHighlighter.cpp LibJS: Remove a bunch of gratuitous JS namespace qualifiers 2022-04-03 15:19:33 +01:00
SyntaxHighlighter.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
SyntheticModule.cpp LibJS: Make Script and Module GC-allocated 2022-09-06 00:27:09 +02:00
SyntheticModule.h LibJS: Make Script and Module GC-allocated 2022-09-06 00:27:09 +02:00
Token.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Token.h Everywhere: Explicitly specify the size in StringView constructors 2022-07-12 23:11:35 +02:00