Skip to content

feat: add datatest to consume ef tests.#119

Merged
mpaulucci merged 1 commit into
mainfrom
add-datatest
Jul 4, 2024
Merged

feat: add datatest to consume ef tests.#119
mpaulucci merged 1 commit into
mainfrom
add-datatest

Conversation

@mpaulucci

Copy link
Copy Markdown
Collaborator

Motivation
We want to be able to consume tests from the fixture files provided by the EF

Description
Adds datatest boilerplate with one working example.

@mpaulucci mpaulucci requested a review from a team as a code owner July 4, 2024 16:49
@mpaulucci mpaulucci changed the title feat: Add datatest to consume ef tests. feat: add datatest to consume ef tests. Jul 4, 2024
Comment thread ef_tests/tests/cancun.rs
datatest_stable::harness!(
eip4788_tests,
"vectors/cancun/eip4788_beacon_root",
r"^.*beacon_root_contract_calls.json"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

we can relax this regex once we start adding support for more tests

@MegaRedHand MegaRedHand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔥 🔥 🔥

@mpaulucci mpaulucci merged commit 8847a00 into main Jul 4, 2024
@mpaulucci mpaulucci deleted the add-datatest branch July 4, 2024 17:35
klaus993 added a commit that referenced this pull request Mar 5, 2026
Fixes CodeQL alert #119 (js/incomplete-multi-character-sanitization).
github-merge-queue Bot pushed a commit that referenced this pull request Mar 5, 2026
…6322)

## Summary

Fixes [CodeQL alert
#119](https://github.com/lambdaclass/ethrex/security/code-scanning/119)
(`js/incomplete-multi-character-sanitization`).

### Problem

In `.github/scripts/set-pr-status.js`, `extractLinkedIssueNumbers`
strips HTML comments from PR bodies before extracting "closes #N"
keywords. The regex used a single-pass replacement:

```js
const withoutComments = body.replace(/<!--[\s\S]*?-->/g, "");
```

A single-pass replacement of `<!--...-->` can leave behind a valid HTML
comment if the input is crafted so that removing one match creates a new
one. For example, input `<!-<!-- foo -->->` would produce `<!-- foo -->`
after one pass.

This means a malicious PR author could hide closing keywords inside
crafted comment nesting to manipulate project board status. The
practical risk is low (CI context, trusted-ish input), but the fix is
trivial.

### Fix

Replace the single-pass `.replace()` with a loop that repeats until
stable:

```js
let withoutComments = body;
let previous;
do {
    previous = withoutComments;
    withoutComments = withoutComments.replace(/<!--[\s\S]*?-->/g, "");
} while (withoutComments !== previous);
```

This is the approach recommended by [CodeQL's own
documentation](https://codeql.github.com/codeql-query-help/javascript/js-incomplete-multi-character-sanitization/)
for this exact alert type.

## Test plan

- No behavioral change for normal PR bodies — the single pass already
removes all comments; the loop just adds a no-op second iteration
confirming stability
- Edge case: nested/overlapping comment markers like `<!-<!-- foo -->->`
are now fully stripped across multiple iterations
- Resolves CodeQL alert `js/incomplete-multi-character-sanitization`
lakshya-sky pushed a commit to lakshya-sky/ethrex that referenced this pull request Mar 10, 2026
…ambdaclass#6322)

## Summary

Fixes [CodeQL alert
lambdaclass#119](https://github.com/lambdaclass/ethrex/security/code-scanning/119)
(`js/incomplete-multi-character-sanitization`).

### Problem

In `.github/scripts/set-pr-status.js`, `extractLinkedIssueNumbers`
strips HTML comments from PR bodies before extracting "closes #N"
keywords. The regex used a single-pass replacement:

```js
const withoutComments = body.replace(/<!--[\s\S]*?-->/g, "");
```

A single-pass replacement of `<!--...-->` can leave behind a valid HTML
comment if the input is crafted so that removing one match creates a new
one. For example, input `<!-<!-- foo -->->` would produce `<!-- foo -->`
after one pass.

This means a malicious PR author could hide closing keywords inside
crafted comment nesting to manipulate project board status. The
practical risk is low (CI context, trusted-ish input), but the fix is
trivial.

### Fix

Replace the single-pass `.replace()` with a loop that repeats until
stable:

```js
let withoutComments = body;
let previous;
do {
    previous = withoutComments;
    withoutComments = withoutComments.replace(/<!--[\s\S]*?-->/g, "");
} while (withoutComments !== previous);
```

This is the approach recommended by [CodeQL's own
documentation](https://codeql.github.com/codeql-query-help/javascript/js-incomplete-multi-character-sanitization/)
for this exact alert type.

## Test plan

- No behavioral change for normal PR bodies — the single pass already
removes all comments; the loop just adds a no-op second iteration
confirming stability
- Edge case: nested/overlapping comment markers like `<!-<!-- foo -->->`
are now fully stripped across multiple iterations
- Resolves CodeQL alert `js/incomplete-multi-character-sanitization`
iovoid pushed a commit that referenced this pull request Mar 16, 2026
…6322)

## Summary

Fixes [CodeQL alert
#119](https://github.com/lambdaclass/ethrex/security/code-scanning/119)
(`js/incomplete-multi-character-sanitization`).

### Problem

In `.github/scripts/set-pr-status.js`, `extractLinkedIssueNumbers`
strips HTML comments from PR bodies before extracting "closes #N"
keywords. The regex used a single-pass replacement:

```js
const withoutComments = body.replace(/<!--[\s\S]*?-->/g, "");
```

A single-pass replacement of `<!--...-->` can leave behind a valid HTML
comment if the input is crafted so that removing one match creates a new
one. For example, input `<!-<!-- foo -->->` would produce `<!-- foo -->`
after one pass.

This means a malicious PR author could hide closing keywords inside
crafted comment nesting to manipulate project board status. The
practical risk is low (CI context, trusted-ish input), but the fix is
trivial.

### Fix

Replace the single-pass `.replace()` with a loop that repeats until
stable:

```js
let withoutComments = body;
let previous;
do {
    previous = withoutComments;
    withoutComments = withoutComments.replace(/<!--[\s\S]*?-->/g, "");
} while (withoutComments !== previous);
```

This is the approach recommended by [CodeQL's own
documentation](https://codeql.github.com/codeql-query-help/javascript/js-incomplete-multi-character-sanitization/)
for this exact alert type.

## Test plan

- No behavioral change for normal PR bodies — the single pass already
removes all comments; the loop just adds a no-op second iteration
confirming stability
- Edge case: nested/overlapping comment markers like `<!-<!-- foo -->->`
are now fully stripped across multiple iterations
- Resolves CodeQL alert `js/incomplete-multi-character-sanitization`
Muzry pushed a commit to Muzry/ethrex that referenced this pull request Mar 17, 2026
…ambdaclass#6322)

## Summary

Fixes [CodeQL alert
lambdaclass#119](https://github.com/lambdaclass/ethrex/security/code-scanning/119)
(`js/incomplete-multi-character-sanitization`).

### Problem

In `.github/scripts/set-pr-status.js`, `extractLinkedIssueNumbers`
strips HTML comments from PR bodies before extracting "closes #N"
keywords. The regex used a single-pass replacement:

```js
const withoutComments = body.replace(/<!--[\s\S]*?-->/g, "");
```

A single-pass replacement of `<!--...-->` can leave behind a valid HTML
comment if the input is crafted so that removing one match creates a new
one. For example, input `<!-<!-- foo -->->` would produce `<!-- foo -->`
after one pass.

This means a malicious PR author could hide closing keywords inside
crafted comment nesting to manipulate project board status. The
practical risk is low (CI context, trusted-ish input), but the fix is
trivial.

### Fix

Replace the single-pass `.replace()` with a loop that repeats until
stable:

```js
let withoutComments = body;
let previous;
do {
    previous = withoutComments;
    withoutComments = withoutComments.replace(/<!--[\s\S]*?-->/g, "");
} while (withoutComments !== previous);
```

This is the approach recommended by [CodeQL's own
documentation](https://codeql.github.com/codeql-query-help/javascript/js-incomplete-multi-character-sanitization/)
for this exact alert type.

## Test plan

- No behavioral change for normal PR bodies — the single pass already
removes all comments; the loop just adds a no-op second iteration
confirming stability
- Edge case: nested/overlapping comment markers like `<!-<!-- foo -->->`
are now fully stripped across multiple iterations
- Resolves CodeQL alert `js/incomplete-multi-character-sanitization`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants