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
Fix buffer overflows (CVE-2021-45958) #519
Merged
bwoodsend
merged 11 commits into
ultrajson:main
from
JustAnotherArchivist:fix-buffer-overflows
Apr 5, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
60929c2
Fix unchecked buffer overflows (CVE-2021-45958).
bwoodsend 62e4853
Add a fuzzing test to search for segfaults in encoding.
bwoodsend 22ca5dc
Remove the hidden JSON_NO_EXTRA_WHITESPACE compile knob.
bwoodsend 3151be2
Fix some more seg-faults on encoding.
bwoodsend fdfb9f4
Add fuzz test to CI/CD.
bwoodsend 7039d60
Refactor buffer reservations to ensure sufficient space on all additions
JustAnotherArchivist 36ffcc8
Widen tests to cover more possible buffer overflows
JustAnotherArchivist 968fb16
actions/checkout@v3
JustAnotherArchivist 3944dae
Clearer pytest command
JustAnotherArchivist 9b50121
python -m pytest
JustAnotherArchivist 7dd7429
Remove shebang
JustAnotherArchivist File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Fuzz | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install . | ||
env: | ||
CFLAGS: '-DDEBUG' | ||
|
||
- name: Fuzz | ||
run: python tests/fuzz.py --seed=0:1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting there's a Python available without
actions/setup-python
, looks like it has Python 3.8.In any case, shall we include an explicit
actions/setup-python
so we don't get any surprises when the version changes? Can we use 3.10?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu ships a Python with it - that's the one that's there by default. It'll get upgraded whenever a new
ubuntu
image is added to GitHub Actions andubuntu-latest
shifts. It's a complete Python3+pip environment and this test shouldn't be Python version dependent so I'd be happy to use it as is.