Open 0drai opened 1 month ago
I think I found the error. When enabling all logs and comparing them to those with vanilla Firefox, there is a log entry that only occurs for Foxhound:
pw:browser [pid=1605671][err] JavaScript error: chrome://juggler/content/TargetRegistry.js, line 158: Error: Internal error: cannot find context for userContextId=6 +191ms
The underlying issue seems to be the following:
let m = new Map();
let nt = Number.tainted(42);
let nu = 42;
m.set(nt, "foo");
m.get(nu)
// undefined
m.get(nt)
// "foo"
I'll rebuild Foxhound with Juggler and some custom logging enabled to confirm this.
Yeah, the taint status of userContextId is different between usages, causing it to not detect the context.
I'm not overly familiar with the primitaint code. Can you have a look @tmbrbr?
@0drai thanks for your interest in Foxhound!
Just wondering if there is a particular reason you are using the 49ac4c1d0de60bfbafaf87fa68b9834a6977d0b4 commit from the primitaint branch?
The current best one to go for if you want primitive tainting is 3de1744b269f8acfd204954431a5c41dd18cbb7e, but this is still based on an old version of Firefox, which may not build any more due to outdated toolchains.
We are working on integrating primitive tainting into the main branch #211 but not sure on the timeline for this.
If I understand the problem correctly, the underlying issue is setting and getting map members with tainted numbers?
@leeN can we add your code snipped above as a new unit test?
Yes, sure. Do you want to add it or shall I make a pull request to your primitaint-merge branch?
Oh, there seems to be a mixup, the build @0drai is using is the current tip of primitaint-merge, sorry. :)
When launching Foxhound with Playwright, the program hangs after trying to create a new page.
Output with
$ DEBUG=pw:api
Log with DEBUG="*browser*"
``` 2024-06-11T06:46:02.933Z pw:browserOS: Ubuntu 22.04 Foxhound: 121.0 (Primitaint https://github.com/SAP/project-foxhound/commit/49ac4c1d0de60bfbafaf87fa68b9834a6977d0b4) Playwright: 1.42.1 Nodejs: 20.14