Skip to content

Commit 9586ebe

Browse files
committed
Avoid calling hasOwnProperty of user-controlled objects
1 parent 34e5072 commit 9586ebe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [3.14.1] - 2020-12-07
10+
### Security
11+
- Fix possible code execution in (already unsafe) `.load()` (in &anchor).
12+
13+
914
## [3.14.0] - 2020-05-22
1015
### Changed
1116
- Support `safe/loadAll(input, options)` variant of call.

lib/js-yaml/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ function readAlias(state) {
12721272

12731273
alias = state.input.slice(_position, state.position);
12741274

1275-
if (!state.anchorMap.hasOwnProperty(alias)) {
1275+
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
12761276
throwError(state, 'unidentified alias "' + alias + '"');
12771277
}
12781278

0 commit comments

Comments
 (0)