The analysis of the security vulnerability CVE-2026-62680 in Orval revealed a Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI) vulnerability. The root cause lies in the unrestricted resolution of external $ref values within OpenAPI specifications. The vulnerability is located in the packages/orval/src/import-specs.ts file.
The investigation focused on the changes introduced by the fixing commit 23786c056f4eba38c02bf2968677988dbbe4de10. Before the patch, the function bundleAndDereferenceExternalRefs used the readFiles() and fetchUrls() methods without any validation or restriction on the provided paths or URLs in the $ref values. This function was called by resolveSpec, which orchestrates the processing of the OpenAPI specification.
An attacker could exploit this by providing a specially crafted OpenAPI specification containing malicious $ref values. When Orval processed this specification, it would trigger requests to arbitrary URLs or read local files from the machine running Orval, leading to potential data exfiltration or internal network reconnaissance.
The patch addresses this by introducing an allow-list mechanism. The resolveSpec function was modified to first collect all external references and validate them against a user-configurable allow-list (parserOptions.externalRefs.allow). The bundleAndDereferenceExternalRefs function was updated to use new wrapper functions, createSafeFileLoader and createSafeUrlLoader, which enforce this allow-list before attempting to read a file or fetch a URL. By default, no external references are allowed, effectively mitigating the vulnerability.