Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add recursion limit for dynamic code #358

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

klauspost
Copy link
Collaborator

@klauspost klauspost commented Sep 6, 2024

Prevent adversarial stack exhaustion on:

Decoder:

  • CopyNext
  • Skip
  • ReadIntf
  • ReadMapStrIntf
  • WriteToJSON

Standalone:

  • Skip
  • ReadMapStrIntfBytes
  • ReadIntfBytes
  • CopyToJSON
  • UnmarshalAsJSON

Limit is set to 100K recursive map/slice operations. I know it is insanely high, but we are really just trying to not run out of stack.

Prevent stack exhaustion on:

Decoder:

* CopyNext
* Skip
* ReadIntf
* ReadMapStrIntf
* WriteToJSON

Standalone:

* Skip
* ReadMapStrIntfBytes
* ReadIntfBytes
* CopyToJSON
* UnmarshalAsJSON

Limit is set to 100K recursive map/slice operations.
@klauspost klauspost requested a review from philhofer September 6, 2024 10:44
@klauspost klauspost merged commit b78c5cd into tinylib:master Sep 6, 2024
4 checks passed
@klauspost klauspost deleted the add-recursion-limit branch September 6, 2024 15:58
mx-psi referenced this pull request in open-telemetry/opentelemetry-collector-contrib Sep 11, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/tinylib/msgp](https://redirect.github.com/tinylib/msgp) |
`v1.2.0` -> `v1.2.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2ftinylib%2fmsgp/v1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2ftinylib%2fmsgp/v1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2ftinylib%2fmsgp/v1.2.0/v1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2ftinylib%2fmsgp/v1.2.0/v1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>tinylib/msgp (github.com/tinylib/msgp)</summary>

###
[`v1.2.1`](https://redirect.github.com/tinylib/msgp/releases/tag/v1.2.1)

[Compare
Source](https://redirect.github.com/tinylib/msgp/compare/v1.2.0...v1.2.1)

##### What's Changed

- Add an unsafe flag so we can continue to use unsafe even when purego …
by [@&#8203;jenn-k-f](https://redirect.github.com/jenn-k-f) in
[https://github.com/tinylib/msgp/pull/356](https://redirect.github.com/tinylib/msgp/pull/356)
- Add pointer receiver directive by
[@&#8203;klauspost](https://redirect.github.com/klauspost) in
[https://github.com/tinylib/msgp/pull/357](https://redirect.github.com/tinylib/msgp/pull/357)
- ci: Add Go 1.23.x - remove Go 1.20.x by
[@&#8203;klauspost](https://redirect.github.com/klauspost) in
[https://github.com/tinylib/msgp/pull/359](https://redirect.github.com/tinylib/msgp/pull/359)
- Add recursion limit for dynamic code by
[@&#8203;klauspost](https://redirect.github.com/klauspost) in
[https://github.com/tinylib/msgp/pull/358](https://redirect.github.com/tinylib/msgp/pull/358)

##### New Contributors

- [@&#8203;jenn-k-f](https://redirect.github.com/jenn-k-f) made their
first contribution in
[https://github.com/tinylib/msgp/pull/356](https://redirect.github.com/tinylib/msgp/pull/356)

**Full Changelog**:
tinylib/msgp@v1.2.0...v1.2.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <[email protected]>
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