Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 96 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"license-header": "license-header --ignore 'packages/**'",
"lint": "biome lint --error-on-warnings"
},
"workspaces": ["packages/cel-spec", "packages/cel", "packages/example"],
"workspaces": [
"packages/cel-spec",
"packages/cel",
"packages/example",
"packages/re2"
],
"type": "module",
"packageManager": "npm@10.9.0",
"licenseHeader": {
Expand Down
7 changes: 4 additions & 3 deletions packages/cel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@
"@bufbuild/protobuf": "^2.6.2"
},
"dependencies": {
"@bufbuild/cel-spec": "0.4.0"
"@bufbuild/cel-spec": "0.4.0",
"@bufbuild/re2": "0.4.0"
},
"devDependencies": {
"expect-type": "^1.3.0",
"peggy": "^5.0.6",
"peggy-ts": "github:hudlow/peggy-ts#v0.0.9",
"expect-type": "^1.3.0"
"peggy-ts": "github:hudlow/peggy-ts#v0.0.9"
}
}
2 changes: 1 addition & 1 deletion packages/cel/src/std/logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function durationOf(func: () => void, times = 5): number {

void suite("logic", () => {
void suite("matches(string, string) -> bool", () => {
void test.skip("doesn't evaluate simple ReDoS expressions in exponential time", () => {
void test("doesn't evaluate simple ReDoS expressions in exponential time", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we merge this before the re2js merge?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently not, it depends on @bufbuild/re2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is a guard against ReDoS. It fails with the current implementation on main, and I expect it to pass in your branch.

It's currently skipped on main because it fails on main. We could merge this change into main, but it means CI would be red, and we'd be stuck if some other work comes along before we can merge your branch.

const maliciousRegex = "^(a*)*$";
const overhead = durationOf(() => matches.call("!", maliciousRegex));

Expand Down
Loading
Loading