From fd599f3e0f3551cd0bd0e7997fac57473e1db0f2 Mon Sep 17 00:00:00 2001 From: Angelo Caporaso <56113767+cap-ang@users.noreply.github.com> Date: Fri, 25 Oct 2024 17:23:12 +0200 Subject: [PATCH] Fix code scanning alert no. 717: Log Injection Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/main/java/it/gov/pagopa/fdr/service/psps/PspsService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/gov/pagopa/fdr/service/psps/PspsService.java b/src/main/java/it/gov/pagopa/fdr/service/psps/PspsService.java index 7cfc452e..f1b0bb37 100644 --- a/src/main/java/it/gov/pagopa/fdr/service/psps/PspsService.java +++ b/src/main/java/it/gov/pagopa/fdr/service/psps/PspsService.java @@ -338,8 +338,9 @@ public void publishByFdr(String action, String pspId, String fdr, boolean intern .thenAccept(value -> { log.info("End of saveOnStorage storage on BlobStorage of FDR payment entities"); fdrEntity.delete(); + String sanitizedFdr = fdr.replace("\n", "").replace("\r", ""); log.infof( - "Delete FdrPaymentInsertEntity by fdr[%s], pspId[%s]", fdrEntity.getRevision(), fdr, pspId); + "Delete FdrPaymentInsertEntity by fdr[%s], pspId[%s]", fdrEntity.getRevision(), sanitizedFdr, pspId); FdrPaymentInsertEntity.deleteByFdrAndPspId(fdr, pspId); log.info("End delete deleteByFdrAndPspId"); this.addToConversionQueue(internalPublish, fdrEntity);