CVE-2016-15028 (published 2023-03-12T15:15Z)

A vulnerability was found in ICEPAY REST-API-NET 0.9. It has been declared as problematic. Affected by this vulnerability is the function RestClient of the file Classes/RestClient.cs of the component Checksum Validation. The manipulation leads to improper validation of integrity check value. The attack can be launched remotely. The complexity of an attack is rather high. The exploitation appears to be difficult. Upgrading to version 1.0 is able to address this issue. The patch is named 61f6b8758e5c971abff5f901cfa9f231052b775f. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-222847.

CVSS v3 base score: 5.9, MEDIUM (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N)

Weakness information:
cwe_id: CWE-354
cwe_name: Improper Validation of Integrity Check Value
description: The product does not validate or incorrectly validates the integrity check values or "checksums" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.
extended_description: Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.
         

Fix information:
repo_url: https://github.com/ICEPAY/REST-API-NET
commit_details: repo_url: https://github.com/ICEPAY/REST-API-NET
author: unknown
author_date: 2016-04-14 14:53:09+02:00
msg: Fixed vulnerability that made a man-in-the-middle attack possible. The checksum header is now always required on responses. If no checksum header is present, it is presumed that the Merchant ID was entered incorrectly.
repository: repo_url: https://github.com/ICEPAY/REST-API-NET
repo_name: ICEPAY/REST-API-NET
description: REST API client for .NET developers
repo_language: C#
owner: ICEPAY
file_changes: filename: Base.cs
change_type: ModificationType.MODIFY
diff: @@ -1,8 +1,4 @@
 ﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace IcepayRestClient.Classes
 {

programming_language: C#
filename: AutomaticCheckout.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Payment
 {
     public class AutomaticCheckoutRequest : CheckoutRequest { }

programming_language: C#
filename: Checkout.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Payment
 {
     public class CheckoutRequest : Base

programming_language: C#
filename: GetMyPaymentMethods.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Payment
 {
     public class GetMyPaymentMethodsRequest : Base { }

programming_language: C#
filename: GetPayment.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Payment
 {
     public class GetPaymentRequest :Base

programming_language: C#
filename: VaultCheckout.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Payment
 {
     public class VaultCheckoutRequest:CheckoutRequest

programming_language: C#
filename: CancelRefund.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Refund
 {
     public class CancelRefundRequest : Base

programming_language: C#
filename: GetPaymentRefunds.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Refund
 {
     public class GetPaymentRefundsRequest : Base

programming_language: C#
filename: RequestRefund.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
+﻿
 namespace IcepayRestClient.Classes.Refund
 {
     public class RequestRefundRequest : Base

programming_language: C#
filename: RestClient.cs
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,4 @@
 ﻿using Newtonsoft.Json;
-using System;
 using System.IO;
 using System.Net;
 using System.Security.Cryptography;
@@ -59,6 +58,7 @@ namespace IcepayRestClient.Classes
             response = JsonConvert.DeserializeObject<TResponse>(rawResponse);
 
             //verify response checksum
+            //always require presence of a checksum header
             if (!string.IsNullOrWhiteSpace(webresponse.Headers["Checksum"]))
             {
                 var responseChecksum = webresponse.Headers["Checksum"];
@@ -66,9 +66,23 @@ namespace IcepayRestClient.Classes
                 var responseVerificationChecksum = Sha256(responseSignString);
                 if (!responseChecksum.Equals(responseVerificationChecksum, System.StringComparison.InvariantCultureIgnoreCase))
                 {
-                    response = new TResponse { Message = "Response signature invalid." };
+                    if (string.IsNullOrWhiteSpace(response.Message))
+                    {
+                        response = new TResponse { Message = "Authentication error: the checksum was incorrect. Verify your secret code." };
+                    }
+                    response = new TResponse { Message = response.Message };
                 }
             }
+            else
+            {
+                //if no checksum header was present in the response, the most likely cause is that the sender ID was invalid
+                //return only the response message and regard the response as failed
+                if (string.IsNullOrWhiteSpace(response.Message))
+                {
+                    response = new TResponse { Message = "Authentication error: no checksum found. Verify your merchant ID." };
+                }
+                response = new TResponse { Message = response.Message };
+            }
 
             //close streams
             writer.Dispose();

programming_language: C#
filename: LICENSE
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,4 @@
-Copyright (c) 2015, ICEPAY - Transaction Performance
+Copyright (c) 2015-2016, ICEPAY - Transaction Performance
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without

programming_language: Markdown
filename: Refund.cs
change_type: ModificationType.MODIFY
diff: @@ -1,9 +1,4 @@
 ﻿using IcepayRestClient.Classes.Refund;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 
 namespace IcepayRestClient
 {

programming_language: Go
filename: ServiceBase.cs
change_type: ModificationType.MODIFY
diff: @@ -1,10 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace IcepayRestClient
+﻿namespace IcepayRestClient
 {
     public abstract class ServiceBase
     {
@@ -14,7 +8,7 @@ namespace IcepayRestClient
         public ServiceBase(int merchantID, string merchantSecret)
         {
             this.MerchantID = merchantID;
-            this.MerchantSecret=merchantSecret;
+            this.MerchantSecret = merchantSecret;
         }
     }
 }

programming_language: C#