mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03:00
fix: CVE-2026-39414 harden S3 Select oversized record handling
Enforce the 1 MiB maxCharsPerRecord limit while splitting CSV and line-delimited JSON input so oversized records are rejected before they can be buffered and parsed. Return OverMaxRecordSize for these failures instead of collapsing them into InternalError, and preserve splitter errors in the JSON worker so oversized-record failures are not lost after successful partial decode.
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
|
||||
package json
|
||||
|
||||
import "errors"
|
||||
|
||||
var errLineTooLong = errors.New("line exceeds maximum allowed length")
|
||||
|
||||
type s3Error struct {
|
||||
code string
|
||||
message string
|
||||
@@ -61,3 +65,12 @@ func errJSONParsingError(err error) *s3Error {
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
func errOverMaxRecordSize(err error) *s3Error {
|
||||
return &s3Error{
|
||||
code: "OverMaxRecordSize",
|
||||
message: "The length of a record in the input or result is greater than maxCharsPerRecord of 1 MB.",
|
||||
statusCode: 400,
|
||||
cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user