CVE-2022-46175 JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain…
설명
JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain by hand (e.g. for config files). The `parse` method of the JSON5 library before and including versions 1.0.1 and 2.2.1 does not restrict parsing of keys named `__proto__`, allowing specially crafted strings to pollute the prototype of the resulting object. This vulnerability pollutes the prototype of the object returned by `JSON5.parse` and not the global Object prototype, which is the commonly understood definition of Prototype Pollution. However, polluting the prototype of a single object can have significant security impact for an application if the object is later used in trusted operations. This vulnerability could allow an attacker to set arbitrary and unexpected keys on the object returned from `JSON5.parse`. The actual impact will depend on how applications utilize the returned object and how they filter unwanted keys, but could include denial of service, cross-site scripting, elevation of privilege, and in extreme cases, remote code execution. `JSON5.parse` should restrict parsing of `__proto__` keys when parsing JSON strings to objects. As a point of reference, the `JSON.parse` method included in JavaScript ignores `__proto__` keys. Simply changing `JSON5.parse` to `JSON.parse` in the examples above mitigates this vulnerability. This vulnerability is patched in json5 versions 1.0.2, 2.2.2, and later.
JSON5는 인기있는 JSON 파일 형식의 확장으로, 손으로 작성하고 유지하기가 더 쉽습니다 (예 : 구성 파일). 버전 1.0.1과 2.2.1을 포함하기 전의 JSON5 라이브러리의 `parse` 메서드는 `__proto__`라는 키의 파싱을 제한하지 않으므로 특별히 만들어진 문자열이 결과 객체의 프로토 타입을 오염시킬 수 있습니다. 이 취약점은 `JSON5.parse`가 반환한 객체의 프로토타입을 오염시키고, 프로토타입 오염의 일반적으로 알려진 정의인 전역 객체 프로토타입을 오염시키지 않는다. 그러나 단일 객체의 프로토타입을 오염시키는 것은 나중에 신뢰할 수 있는 작업에 객체를 사용하는 경우 애플리케이션에 상당한 보안 영향을 미칠 수 있습니다. 이 취약점으로 인해 공격자는 `JSON5.parse`에서 반환된 개체에 임의 및 예기치 않은 키를 설정할 수 있습니다. 실제 영향은 애플리케이션이 반환된 객체를 어떻게 활용하느냐와 원치 않는 키를 어떻게 필터링하느냐에 따라 달라지지만, 서비스 거부, 크로스 사이트 스크립팅, 권한 상승, 그리고 극단적인 경우 원격 코드 실행을 포함할 수 있다. `JSON5.parse`는 JSON 문자열을 객체에 파싱할 때 `__proto__` 키의 파싱을 제한해야 한다. 참조의 포인트로서, JavaScript에 포함된 `JSON.parse` 메서드는 `__proto__` 키를 무시합니다. 위의 예에서 `JSON5.parse`를 `JSON.parse'로 변경하기만 하면 이 취약점이 완화됩니다. 이 취약점은 json5 버전 1.0.2, 2.2.2 및 이후 버전에서 패치됩니다.
영향 받는 제품 제품 1개
-
해결 버전 있음
json5
json5
영향 받는 버전
- 2.2.2 미만
해결 버전
- 2.2.2 이상
참고 자료 6건
- github.com https://github.com/json5/json5/issues/199 (새 창)
- github.com https://github.com/json5/json5/issues/295 (새 창)
- github.com https://github.com/json5/json5/pull/298 (새 창)
- github.com https://github.com/json5/json5/security/advisories/GHSA-9c47-m6qq-7p4h (새 창)
- lists.debian.org https://lists.debian.org/debian-lts-announce/2023/11/msg00021.html (새 창)
- lists.fedoraproject.org https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3S26TLPLVFAJTUN3VIXFDEBEXDYO22CE/ (새 창)