Critical severityNVD Advisory· Published Feb 19, 2026· Updated Mar 6, 2026
Authenticated arbitrary file upload via a System REST API requiring administrator permission.
CVE-2025-13590
Description
A malicious actor with administrative privileges can upload an arbitrary file to a user-controlled location within the deployment via a system REST API. Successful uploads may lead to remote code execution.
By leveraging the vulnerability, a malicious actor may perform Remote Code Execution by uploading a specially crafted payload.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.implMaven | < 9.32.167 | 9.32.167 |
Affected products
3- Range: 4.5.0
- Range: 9.28.116
- WSO2/WSO2 Universal Gatewayv5Range: 4.5.0
Patches
149a6427b39a5Merge pull request #13560 from PasanT9/fix-112
2 files changed · +21 −1
components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/importexport/ImportExportConstants.java+1 −0 modified@@ -72,6 +72,7 @@ public final class ImportExportConstants { public static final String JSON_EXTENSION = ".json"; public static final String YAML_EXTENSION = ".yaml"; + public static final String YML_EXTENSION = ".yml"; // Image resource public static final String IMAGE_RESOURCE = "Image";
components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/ThrottlingApiServiceImpl.java+20 −1 modified@@ -1225,13 +1225,32 @@ public Response exportThrottlingPolicy(String policyId, String policyName, Strin */ public static ExportThrottlePolicyDTO getImportedPolicy(InputStream uploadedInputStream, Attachment fileDetail) throws ParseException, APIImportExportException, IOException { + File importFolder = CommonUtil.createTempDirectory(null); String uploadFileName = fileDetail.getContentDisposition().getFilename(); - String fileType = (uploadFileName.contains(ImportExportConstants.YAML_EXTENSION)) ? + if (StringUtils.isEmpty(uploadFileName)) { + throw new APIImportExportException("Invalid file name. File name cannot be null or empty."); + } + // Validate file extension to prevent uploading unauthorized file types + String lowerCaseFileName = uploadFileName.toLowerCase(); + boolean isYamlFile = + lowerCaseFileName.endsWith(ImportExportConstants.YAML_EXTENSION) || lowerCaseFileName.endsWith( + ImportExportConstants.YML_EXTENSION); + boolean isJsonFile = lowerCaseFileName.endsWith(ImportExportConstants.JSON_EXTENSION); + if (!isYamlFile && !isJsonFile) { + throw new APIImportExportException("Invalid file type. Only YAML and JSON files are allowed."); + } + String fileType = isYamlFile ? ImportExportConstants.EXPORT_POLICY_TYPE_YAML : ImportExportConstants.EXPORT_POLICY_TYPE_JSON; + // Validating the canonical path String absolutePath = importFolder.getAbsolutePath() + File.separator + uploadFileName; File targetFile = new File(absolutePath); + String canonicalPath = targetFile.getCanonicalPath(); + String canonicalImportPath = importFolder.getCanonicalPath(); + if (!canonicalPath.startsWith(canonicalImportPath + File.separator)) { + throw new APIImportExportException("Invalid file name."); + } FileUtils.copyInputStreamToFile(uploadedInputStream, targetFile); return preprocessImportedArtifact(absolutePath, fileType); }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-p6jf-79j3-33f3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-13590ghsaADVISORY
- security.docs.wso2.com/en/latest/security-announcements/security-advisories/2026/WSO2-2025-4849/mitrevendor-advisory
- github.com/wso2/carbon-apimgt/commit/49a6427b39a5d9552ce97430858bb4b1912a3044ghsaWEB
- github.com/wso2/carbon-apimgt/pull/13560ghsaWEB
- github.com/wso2/carbon-apimgt/releases/tag/v9.32.167ghsaWEB
- security.docs.wso2.com/en/latest/security-announcements/security-advisories/2026/WSO2-2025-4849ghsaWEB
News mentions
0No linked articles in our index yet.