Title: signature: fix out-of-bounds read when parsing timezone offset by pks-t · Pull Request #4883 · libgit2/libgit2 · GitHub
Open Graph Title: signature: fix out-of-bounds read when parsing timezone offset by pks-t · Pull Request #4883 · libgit2/libgit2
X Title: signature: fix out-of-bounds read when parsing timezone offset by pks-t · Pull Request #4883 · libgit2/libgit2
Description: When parsing a signature's timezone offset, we first check whether there is a timezone at all by verifying that there are still bytes left to read following the time itself. The check thus looks like time_end + 1 < buffer_end, which is actually correct in this case. After setting the timezone's start pointer to that location, we compute the remaining bytes by using the formula buffer_end - tz_start + 1, re-using the previous time_end + 1. But this is in fact missing the braces around (tz_start + 1), thus leading to an overestimation of the remaining bytes by a length of two. In case of a non-NUL terminated buffer, this will result in an overflow. The function git_signature__parse is only used in two locations. First is git_signature_from_buffer, which only accepts a string without a length. The string thus necessarily has to be NUL terminated and cannot trigger the issue. The other function is git_commit__parse_raw, which can in fact trigger the error as it may receive non-NUL terminated commit data. But as objects read from the ODB are always NUL-terminated by us as a cautionary measure, it cannot trigger the issue either. In other words, this error does not have any impact on security.
Open Graph Description: When parsing a signature's timezone offset, we first check whether there is a timezone at all by verifying that there are still bytes left to read following the time itself. The check thus look...
X Description: When parsing a signature's timezone offset, we first check whether there is a timezone at all by verifying that there are still bytes left to read following the time itself. The check thus ...
Opengraph URL: https://github.com/libgit2/libgit2/pull/4883
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5cabf907-fdd7-7c08-425a-bc6300b3b894 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DB9C:35F5B8:59F8060:78254AE:6A5DDE4A |
| html-safe-nonce | a1a2148f6067be5f26b2eb85ece8e11f143f08d15056848224a2e54cd062d30f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjlDOjM1RjVCODo1OUY4MDYwOjc4MjU0QUU6NkE1RERFNEEiLCJ2aXNpdG9yX2lkIjoiNjE1NDU4NTYzMjE0NDAxMDk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8cdc14e26f65fb0c82aa5561dad0b7e42a35fc0d9ca0b450afe1b592170630b2 |
| hovercard-subject-tag | pull_request:229783794 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/libgit2/libgit2/pull/4883/files |
| twitter:image | https://avatars.githubusercontent.com/u/4056630?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4056630?s=400&v=4 |
| og:image:alt | When parsing a signature's timezone offset, we first check whether there is a timezone at all by verifying that there are still bytes left to read following the time itself. The check thus look... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/libgit2/libgit2 git https://github.com/libgit2/libgit2.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 901662 |
| octolytics-dimension-repository_nwo | libgit2/libgit2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 901662 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2 |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width