)]}'
{
  "commit": "d057d0b7f18a285b2dcf7fa76e1342beeda530ca",
  "tree": "432e5c59364d7e58259bbb94424c8e80e7cedf6a",
  "parents": [
    "585cc913fcbd6b668c37bef083066d0e2ffb3a42"
  ],
  "author": {
    "name": "Jonas Finnemann Jensen",
    "email": "jonasfj@google.com",
    "time": "Thu Oct 29 13:52:52 2026 +0000"
  },
  "committer": {
    "name": "Jonas Finnemann Jensen",
    "email": "jonasfj@google.com",
    "time": "Mon Nov 09 08:53:33 2026 +0000"
  },
  "message": "[markdown] Add regression, scaling, and fuzzer tests for DoS fixes\n\nAdd `pkgs/markdown/test/pathological_test.dart`, expand\n`pkgs/markdown/test/regression_test.dart`, and document the DoS fixes in\n`pkgs/markdown/CHANGELOG.md`.\n\n----\n\nEach of the preceding commits fixes a quadratic O(n^2), exponential O(2^n), or\ndeep-recursion (`StackOverflowError`) vulnerability in `package:markdown`.\nWithout automated scaling assertions, deep-nesting tests, and fuzz testing over\nadversarial token combinations, regressions in regexes, delimiter processing, or\nAST traversal could silently reintroduce super-linear behavior without breaking\nfunctional CommonMark/GFM output tests.\n\n1. **`pkgs/markdown/test/pathological_test.dart`**:\n   - **Linear-scaling suite (`_cases`)**: Tests 51 pathological input generators\n     in both CommonMark and GFM (`ExtensionSet.gitHubWeb`) modes at 8 KB and\n     64 KB (8x size ratio), asserting that the 64 KB render time is within a\n     bounded linear multiple (`3 * _scale`) of the 8 KB render time (where\n     linear growth is ~8x and quadratic growth is ~64x).\n   - **Deep-nesting suite (`_deepCases`)**: Renders 6 deep-nesting generators at\n     depth 32,000 (nested strong emphasis, nested strong emphasis run, nested\n     strong emphasis with trailing text, nested strong emphasis in image alt,\n     nested blockquotes, and nested lists) in both CommonMark and GFM modes to\n     verify that no `StackOverflowError` is thrown.\n   - **Custom `linkBuilder` regression test**: Verifies that a custom\n     `linkBuilder` that does not invoke `getChildren()` produces the expected\n     AST when earlier delimiters resolve into emphasis elements.\n   - **Token-alphabet fuzzer**: Runs 200 deterministic PRNG iterations (`Random(42)`),\n     each picking a random subset of 2–6 tokens from a 23-token Markdown\n     alphabet and generating a 2,000-token string to verify that arbitrary token\n     combinations render in under 2 seconds without hanging or throwing.\n2. **`pkgs/markdown/test/regression_test.dart`**:\n   - Adds targeted timing regression tests for unclosed inline link destinations\n     and titles and inline delimiter runs.\n3. **`pkgs/markdown/CHANGELOG.md`**:\n   - Documents the security and performance fixes under `7.4.1-wip`.\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ffd6dbbf248714fecd3c111056bb6acf82a04237",
      "new_mode": 33188,
      "new_path": "pkgs/markdown/test/pathological_test.dart"
    }
  ]
}
