CVE-2016-15028 (C#, published 2023-03-12T15:15Z)
Description: value: 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.
Severity: nan (CVSS v3 base score: 5.9)
Weakness: CWE-354 \u2014 Improper Validation of Integrity Check Value
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.
Repository: https://github.com/ICEPAY/REST-API-NET
Files changed:
Classes/Base.cs
Classes/Payment/AutomaticCheckout.cs
Classes/Payment/Checkout.cs
Classes/Payment/GetMyPaymentMethods.cs
Classes/Payment/GetPayment.cs
Classes/Payment/VaultCheckout.cs
Classes/Refund/CancelRefund.cs
Classes/Refund/GetPaymentRefunds.cs
Classes/Refund/RequestRefund.cs
Classes/RestClient.cs
LICENSE
Refund.cs
ServiceBase.cs
Commit message: 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.


Vulnerable code:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System;
                    response = new TResponse { Message = "Response signature invalid." };
Copyright (c) 2015, ICEPAY - Transaction Performance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IcepayRestClient
            this.MerchantSecret=merchantSecret;

Fixed code:
﻿
﻿
﻿
﻿
﻿
﻿
﻿
﻿
            //always require presence of a checksum header
                    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 };
            }
Copyright (c) 2015-2016, ICEPAY - Transaction Performance
﻿namespace IcepayRestClient
            this.MerchantSecret = merchantSecret;