mirror of
https://github.com/fkie-cad/nvd-json-data-feeds.git
synced 2025-05-28 17:21:36 +00:00
137 lines
8.5 KiB
JSON
137 lines
8.5 KiB
JSON
{
|
|
"id": "CVE-2022-1642",
|
|
"sourceIdentifier": "cve@forums.swift.org",
|
|
"published": "2022-06-16T17:15:07.763",
|
|
"lastModified": "2024-11-21T06:41:09.587",
|
|
"vulnStatus": "Modified",
|
|
"cveTags": [],
|
|
"descriptions": [
|
|
{
|
|
"lang": "en",
|
|
"value": "A program using swift-corelibs-foundation is vulnerable to a denial of service attack caused by a potentially malicious source producing a JSON document containing a type mismatch. This vulnerability is caused by the interaction between a deserialization mechanism offered by the Swift standard library, the Codable protocol; and the JSONDecoder class offered by swift-corelibs-foundation, which can deserialize types that adopt the Codable protocol based on the content of a provided JSON document. When a type that adopts Codable requests the initialization of a field with an integer value, the JSONDecoder class uses a type-erased container with different accessor methods to attempt and coerce a corresponding JSON value and produce an integer. In the case the JSON value was a numeric literal with a floating-point portion, JSONDecoder used different type-eraser methods during validation than it did during the final casting of the value. The checked casting produces a deterministic crash due to this mismatch. The JSONDecoder class is often wrapped by popular Swift-based web frameworks to parse the body of HTTP requests and perform basic type validation. This makes the attack low-effort: sending a specifically crafted JSON document during a request to these endpoints will cause them to crash. The attack does not have any confidentiality or integrity risks in and of itself; the crash is produced deterministically by an abort function that ensures that execution does not continue in the face of this violation of assumptions. However, unexpected crashes can lead to violations of invariants in services, so it's possible that this attack can be used to trigger error conditions that escalate the risk. Producing a denial of service may also be the goal of an attacker in itself. This issue is solved in Swift 5.6.2 for Linux and Windows. This issue was solved by ensuring that the same methods are invoked both when validating and during casting, so that no type mismatch occurs. Swift for Linux and Windows versions are not ABI-interchangeable. To upgrade a service, its owner must update to this version of the Swift toolchain, then recompile and redeploy their software. The new version of Swift includes an updated swift-corelibs-foundation package. Versions of Swift running on Darwin-based operating systems are not affected."
|
|
},
|
|
{
|
|
"lang": "es",
|
|
"value": "Un programa usando swift-corelibs-foundation es vulnerable a un ataque de denegaci\u00f3n de servicio causado por una fuente potencialmente maliciosa que produce un documento JSON que contiene un desajuste de tipo. Esta vulnerabilidad est\u00e1 causada por la interacci\u00f3n entre un mecanismo de deserializaci\u00f3n ofrecido por la biblioteca est\u00e1ndar de Swift, el protocolo Codable; y la clase JSONDecoder ofrecida por swift-corelibs-foundation, que puede de serializar tipos que adoptan el protocolo Codable bas\u00e1ndose en el contenido de un documento JSON proporcionado. Cuando un tipo que adopta Codable solicita la inicializaci\u00f3n de un campo con un valor entero, la clase JSONDecoder usa un contenedor de tipo con diferentes m\u00e9todos de acceso para intentar y coaccionar un valor JSON correspondiente y producir un entero. En el caso de que el valor JSON fuera un literal num\u00e9rico con una porci\u00f3n de punto flotante, JSONDecoder us\u00f3 diferentes m\u00e9todos de borrado de tipo durante la comprobaci\u00f3n que durante el casting final del valor. La comprobaci\u00f3n del casting produce un bloqueo determinista debido a este desajuste. La clase JSONDecoder se usa a menudo en marcos web populares basados en Swift para analizar el cuerpo de las peticiones HTTP y llevar a cabo una comprobaci\u00f3n de tipo b\u00e1sica. Esto hace que el ataque sea de bajo esfuerzo: el env\u00edo de un documento JSON espec\u00edficamente dise\u00f1ado durante una petici\u00f3n a estos puntos finales causar\u00e1 su bloqueo. El ataque no presenta ning\u00fan riesgo de confidencialidad o integridad en s\u00ed mismo; el bloqueo es producido de forma determinista mediante una funci\u00f3n de abortar que asegura que la ejecuci\u00f3n no contin\u00fae ante esta violaci\u00f3n de los supuestos. Sin embargo, los bloqueos no esperados pueden conllevar a violaciones de invariantes en los servicios, por lo que es posible que este ataque pueda ser usado para desencadenar condiciones de error que escalen el riesgo. Producir una denegaci\u00f3n de servicio tambi\u00e9n puede ser el objetivo de un atacante en s\u00ed mismo. Este problema ha sido resuelto en Swift versi\u00f3n 5.6.2 para Linux y Windows. Este problema ha sido resuelto asegurando que sean invocados los mismos m\u00e9todos tanto cuando es validado como durante el casting, para que no sea producido un desajuste de tipos. Las versiones de Swift para Linux y Windows no son intercambiables con la ABI. Para actualizar un servicio, su propietario debe actualizar a esta versi\u00f3n de la cadena de herramientas Swift, y luego recompilar y volver a desplegar su software. La nueva versi\u00f3n de Swift incluye un paquete swift-corelibs-foundation actualizado. Las versiones de Swift que son ejecutadas en sistemas operativos basados en Darwin no est\u00e1n afectadas"
|
|
}
|
|
],
|
|
"metrics": {
|
|
"cvssMetricV31": [
|
|
{
|
|
"source": "nvd@nist.gov",
|
|
"type": "Primary",
|
|
"cvssData": {
|
|
"version": "3.1",
|
|
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
|
|
"baseScore": 7.5,
|
|
"baseSeverity": "HIGH",
|
|
"attackVector": "NETWORK",
|
|
"attackComplexity": "LOW",
|
|
"privilegesRequired": "NONE",
|
|
"userInteraction": "NONE",
|
|
"scope": "UNCHANGED",
|
|
"confidentialityImpact": "NONE",
|
|
"integrityImpact": "NONE",
|
|
"availabilityImpact": "HIGH"
|
|
},
|
|
"exploitabilityScore": 3.9,
|
|
"impactScore": 3.6
|
|
}
|
|
],
|
|
"cvssMetricV2": [
|
|
{
|
|
"source": "nvd@nist.gov",
|
|
"type": "Primary",
|
|
"cvssData": {
|
|
"version": "2.0",
|
|
"vectorString": "AV:N/AC:L/Au:N/C:N/I:N/A:P",
|
|
"baseScore": 5.0,
|
|
"accessVector": "NETWORK",
|
|
"accessComplexity": "LOW",
|
|
"authentication": "NONE",
|
|
"confidentialityImpact": "NONE",
|
|
"integrityImpact": "NONE",
|
|
"availabilityImpact": "PARTIAL"
|
|
},
|
|
"baseSeverity": "MEDIUM",
|
|
"exploitabilityScore": 10.0,
|
|
"impactScore": 2.9,
|
|
"acInsufInfo": false,
|
|
"obtainAllPrivilege": false,
|
|
"obtainUserPrivilege": false,
|
|
"obtainOtherPrivilege": false,
|
|
"userInteractionRequired": false
|
|
}
|
|
]
|
|
},
|
|
"weaknesses": [
|
|
{
|
|
"source": "cve@forums.swift.org",
|
|
"type": "Secondary",
|
|
"description": [
|
|
{
|
|
"lang": "en",
|
|
"value": "CWE-241"
|
|
},
|
|
{
|
|
"lang": "en",
|
|
"value": "CWE-351"
|
|
},
|
|
{
|
|
"lang": "en",
|
|
"value": "CWE-704"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"source": "nvd@nist.gov",
|
|
"type": "Primary",
|
|
"description": [
|
|
{
|
|
"lang": "en",
|
|
"value": "CWE-704"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"configurations": [
|
|
{
|
|
"nodes": [
|
|
{
|
|
"operator": "OR",
|
|
"negate": false,
|
|
"cpeMatch": [
|
|
{
|
|
"vulnerable": true,
|
|
"criteria": "cpe:2.3:a:apple:swift:*:*:*:*:*:linux:*:*",
|
|
"versionEndExcluding": "5.6.2",
|
|
"matchCriteriaId": "948FAB08-D0EF-4C51-A582-8F5FC590C90E"
|
|
},
|
|
{
|
|
"vulnerable": true,
|
|
"criteria": "cpe:2.3:a:apple:swift:*:*:*:*:*:windows:*:*",
|
|
"versionEndExcluding": "5.6.2",
|
|
"matchCriteriaId": "759FF480-D09B-4261-A254-579DAF4D9AC2"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"references": [
|
|
{
|
|
"url": "https://github.com/apple/swift-corelibs-foundation/security/advisories/GHSA-239c-6cv2-wwx8",
|
|
"source": "cve@forums.swift.org",
|
|
"tags": [
|
|
"Third Party Advisory"
|
|
]
|
|
},
|
|
{
|
|
"url": "https://github.com/apple/swift-corelibs-foundation/security/advisories/GHSA-239c-6cv2-wwx8",
|
|
"source": "af854a3a-2127-422b-91ae-364da2661108",
|
|
"tags": [
|
|
"Third Party Advisory"
|
|
]
|
|
}
|
|
]
|
|
} |