googleprojectzero / googleprojectzero/fuzzilli

Switch Case Problem

Open
#441 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.3k
Forks
367
Avg merge
23h 53m
Merged PRs (30d)
1

Description

Problem:

At the moment we precompute the tests for each switch case and then use the precomputated Variables in each switch case. It would be better to compute the test immediately before making a switch case, however this is not possible because in a Switch block but outside of a switch case there is no javascript context.

Solution Approach:

We could add a SwitchCaseHeader to FuzzIL that opens a javascript context. However this would necessitate changing many files and the payoff for that would only be the ability to correctly compile some very rare and specific cases like the one above. The code above can be used to test if a fix works.

Testbench

A nice illustration for how this problem can manifest can be found here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked Fuzzilli pull request discussion and the switch-case testbench described in the issue. Then trace how FuzzIL represents and compiles switch blocks and cases. Done means the specific rare case can compute its test immediately before entering the switch case while retaining the required JavaScript context.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.