fix(deps): update dependency valibot to v1.4.2 [security] - #727
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency valibot to v1.4.2 [security]#727renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
10 times, most recently
from
December 3, 2025 13:27
bc30ce5 to
cd33df6
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
9 times, most recently
from
December 10, 2025 11:14
7a4ea89 to
e8c396b
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
4 times, most recently
from
December 15, 2025 21:51
d448186 to
622e4ad
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
4 times, most recently
from
December 24, 2025 05:58
4473eff to
fed3879
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
7 times, most recently
from
January 5, 2026 21:45
6d45259 to
025c34e
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
9 times, most recently
from
January 15, 2026 05:10
698f8ac to
21a36b8
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
from
January 16, 2026 06:47
21a36b8 to
976dc8f
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
from
February 2, 2026 15:05
976dc8f to
fe3d0f8
Compare
auto-merge was automatically disabled
March 27, 2026 01:34
Pull request was closed
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
2 times, most recently
from
March 30, 2026 22:11
fe3d0f8 to
c4b97cb
Compare
renovate
Bot
force-pushed
the
renovate/npm-valibot-vulnerability
branch
from
July 28, 2026 09:37
c4b97cb to
c8f3df9
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR contains the following updates:
1.0.0→1.4.2Valibot has a ReDoS vulnerability in
EMOJI_REGEXCVE-2025-66020 / GHSA-vqpr-j7v3-hqw9
More information
Details
Summary
The
EMOJI_REGEXused in theemojiaction is vulnerable to a Regular Expression Denial of Service (ReDoS) attack. A short, maliciously crafted string (e.g., <100 characters) can cause the regex engine to consume excessive CPU time (minutes), leading to a Denial of Service (DoS) for the application.Details
The ReDoS vulnerability stems from "catastrophic backtracking" in the
EMOJI_REGEX. This is caused by ambiguity in the regex pattern due to overlapping character classes.Specifically, the class
\p{Emoji_Presentation}overlaps with more specific classes used in the same alternation, such as[\u{1F1E6}-\u{1F1FF}](regional indicator symbols used for flags) and\p{Emoji_Modifier_Base}.When the regex engine attempts to match a string that almost matches but ultimately fails (like the one in the PoC), this ambiguity forces it to explore an exponential number of possible paths. The matching time increases exponentially with the length of the crafted input, rather than linearly.
PoC
The following code demonstrates the vulnerability.
Impact
Any project using Valibot's
emojivalidation on user-controllable input is vulnerable to a Denial of Service attack.An attacker can block server resources (e.g., a web server's event loop) by submitting a short string to any endpoint that uses this validation. This is particularly dangerous because the attack string is short enough to bypass typical input length restrictions (e.g., maxLength(100)).
Recommended Fix
The root cause is the overlapping character classes. This can be resolved by making the alternatives mutually exclusive, typically by using negative lookaheads (
(?!...)) to subtract the specific classes from the more general one.The following modified
EMOJI_REGEXapplies this principle:Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Valibot: record() issue paths can make flatten() throw for inherited Object property names
CVE-2026-59952 / GHSA-5qjj-4xww-7phc
More information
Details
Summary
valibot1.4.1 can throw aTypeErrorinside itsflatten()helper when validation issues contain attacker-controlled object keys such astoString,valueOf, orhasOwnProperty.The issue is reachable through normal
record()validation.record()intentionally filters__proto__,prototype, andconstructor, but it still accepts other own keys that collide with inheritedObject.prototypeproperties. If the record key schema or value schema rejects such an entry, Valibot creates an issue path containing that key. Passing the resulting issues to Valibot's documentedflatten()helper causesflatErrors.nested[dotPath]to resolve to the inherited method instead of an own error array, and the helper calls.push(...)on that function.This is not a global prototype pollution issue. The impact is availability/error handling: applications that validate user-controlled objects with
record()and flatten validation errors for API responses can crash the request path with aTypeErrorinstead of returning structured validation errors.Affected package
valibot1.4.1open-circle/valibot9bb6617Root cause
record()uses_isValidObjectKey()before validating record entries. The helper blocks the three classic prototype pollution keys:It does not block other inherited
Object.prototypenames such astoString,valueOf, andhasOwnProperty. These remain valid own JSON object keys and can appear in issue paths when either the record key schema or value schema rejects the entry.flatten()then creates nested error storage with an ordinary object:For a dot path such as
toString, this check reads the inheritedObject.prototype.toStringfunction:Because the inherited function is truthy,
flatten()calls.push(...)on a function and throwsTypeError: flatErrors.nested[dotPath].push is not a function.Impact
A remote attacker can trigger this if an application:
v.record(...);toString;flatten(result.issues)helper to prepare validation errors.This is a common pattern in API/form validation:
safeParse()collects issues andflatten()converts them into response-friendly error objects. Instead of a validation response, the request can hit an unexpected exception path.The same root cause can also affect manually constructed issues or other schemas that place inherited Object property names into dot paths. I am reporting the
record()path because it uses only public Valibot APIs and attacker-controlled JSON keys.Local reproduction
Run in a disposable directory:
Minimal example:
Observed output from
valibot@1.4.1:{ "name": "record value schema rejects attacker-controlled value", "key": "toString", "success": false, "issueCount": 1, "firstPath": ["toString"], "firstMessage": "Invalid type: Expected number but received \"not-a-number\"", "flattened": { "ok": false, "exception": "TypeError", "message": "flatErrors.nested[dotPath].push is not a function" } }The local PoC also reproduces the same exception for
valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable, andtoLocaleString. A control case with an ordinary key produces normal flattened errors.Duplicate checks performed before submission
valibotrelease is1.4.1and maps toopen-circle/valibot.gh api repos/open-circle/valibot/private-vulnerability-reportingreturned{"enabled":true}.npm auditfor a clean project containing onlyvalibot@1.4.1returned no vulnerabilities.1.2.0.valibot1.4.1returned no vulnerabilities.flatten toString,flatten hasOwnProperty,record toString,__proto__,constructor, andprototype pollutiondid not find a matching disclosure of thisrecord()issue-path /flatten()exception.open-circle/valibot#67added prototype pollution mitigation forrecord()by blacklisting__proto__,prototype, andconstructor; it does not coverflatten()collisions with other inherited property names.open-circle/valibot#1429is an open plain-object /record()type semantics PR and does not disclose thisflatten()exception behavior.Suggested remediation
Use null-prototype containers for flat error maps and/or perform own-property checks before appending:
flatErrors.nestedasObject.create(null).Object.prototype.hasOwnProperty.call(flatErrors.nested, dotPath)rather than truthiness.getDotPath()/flatten(), including inherited Object property names.flatten()with pathstoString,valueOf,hasOwnProperty,__proto__,prototype, andconstructor.Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
open-circle/valibot (valibot)
v1.4.2Compare Source
Many thanks to @Faze-up and @chatman-media for contributing to this release.
Intl.Segmenterfor non-primitive locales, preventing it from being recreated on everywords,minWords,maxWordsandnotWordsvalidation (pull request #1521)flattenmethod to handle issue path keys that collide withObject.prototypemembers liketoStringinstead of throwing aTypeError(pull request #1522)intersectschema to merge object keys that collide withObject.prototypemembers liketoStringinstead of failing to merge them (pull request #1522)v1.4.1Compare Source
intersectschema to infer correct input and output types for non-tuple array options instead ofnever(pull request #1478)v1.4.0Compare Source
Many thanks to @ksaurav24, @heiwen, @compulim, @ysknsid25, @alaycock-stripe, @IlyaSemenov, @wszgrcy, @LMGO, @yslpn, @EltonLobo07 and @Eronmmer for contributing to this release.
isoDateTimeSecondvalidation action to validate ISO date times with seconds (pull request #1418)toCamelCase,toKebabCase,toPascalCaseandtoSnakeCasetransformation actions to convert strings between common naming conventions (pull request #1457)ReadonlyOutputKeysandOutputWithReadonlytypes ofobjectschemas andWithReadonlytype ofrecordschemas to improve TypeScript type performance (pull request #1442)_LruCacheto use a TypeScriptprivatemethod instead of a#privateclass field to avoid runtime helpers in the transpiled output (pull request #1455)_isValidObjectKeyto useObject.prototype.hasOwnProperty.callinstead ofObject.hasOwnso the distributed output stays compatible with runtimes that lack the ES2022Object.hasOwnbuiltin (pull request #1421)flattenmethod to accept readonly issue arrays (pull request #1269)RangeErrorcaused by spreading large issue arrays (pull request #1437)creditCardvalidation action to reject Mastercard numbers with invalid lengths (pull request #1462)intersectschema to no longer mutate input values, allowing frozen objects and arrays to be merged (pull request #1463)v1.3.1Compare Source
MAC48_REGEX,MAC64_REGEXandMAC_REGEXto drop theiflag for better JSON Schema compatibility (pull request #1430)hashaction to use case-expanded character classes instead of theiflag (pull request #1430)v1.3.0Compare Source
Many thanks to @EskiMojo14, @yslpn, @alexilyaev, @idleberg, @BerkliumBirb and @frenzzy for contributing to this release.
guardtransformation action to narrow types using type predicates (pull request #1204)parseBooleantransformation action to parse boolean values from strings and other types (pull request #1251)isrcvalidation action to validate ISRC codes (pull request #1373)cachemethod for caching schema output by input (pull request #1170)domainvalidation action to validate domain names (pull request #1284)jwsCompactvalidation action to validate JWS compact strings (pull request #1348)creditCardvalidation action to allow 13-digit Visa card numbers (pull request #1347)isoTimestampvalidation action to allow optional space before UTC offset for PostgreSQLtimestamptzcompatibility (pull request #1195)v1.2.0Compare Source
Many thanks to @EskiMojo14, @makenowjust, @ysknsid25 and @jacekwilczynski for contributing to this release.
toBigint,toBoolean,toDate,toNumberandtoStringtransformation actions (pull request #1212)examplesaction to add example values to a schema (pull request #1199)getExamplesmethod to extract example values from a schema (pull request #1199)isbnvalidation action to validate ISBN-10 and ISBN-13 strings (pull request #1097)RawCheckAddIssue,RawCheckContext,RawCheckIssueInfo,RawTransformAddIssue,RawTransformContextandRawTransformIssueInfotypes for better developer experience withrawCheckandrawTransformactions (pull request #1359)EMOJI_REGEXused byemojiactionv1.1.0Compare Source
Many thanks to @EltonLobo07, @sacrosanctic, @muningis, @EskiMojo14, @MOZGIII, @vktrl and @jasperteo for contributing to this release.
messagemethod to overwrite local error message configuration of a schema (pull request #1103)summarizemethod to summarize issues into a pretty-printable multi-line string (pull request #1158)getTitle,getDescriptionandgetMetadatamethods to extract metadata of a schema (pull request #1154)minEntriesandmaxEntriesvalidation action to validate number of object entries (pull request #1100)entriesandnotEntriesvalidation action to validate number of object entries (pull request #1156)parseJsonandstringifyJsontransformation action to parse and stringify JSON (pull request #1137)flavortransformation action to flavor the output type of a schema (pull request #950)multipleOfvalidation action (pull request #1164)variantandvariantAsyncschema to improve performance by aborting validation of discriminators early (pull request #1110)NanoIDActionandNanoIDIssueinterface toNanoIdActionandNanoIdIssue(pull request #1171)MarkOptionaltype to fix input and output type of objects in edge cases (issue #1176)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.