#sepafail SEPA bulk transfers with the ChipTAN procedure at Sparkasse are not secure

SEPA files are a convenient way to transfer money. A SEPA file contains all transfer items collected together.

Convenient, fast and automatic

Since the SEPA file is machine-readable, for example, accounting programs can output salary transfers in bundles. An employee only needs to upload these in online banking and the salaries are then transferred. Step 1: Upload file Step 1: Upload file The items are listed to the user once more to ensure that the data is correct.Step 2: Verify data Step 2: Verify data Finally, the TAN is generated to approve the transfers.Step 3: Generate TAN with ChipTAN procedure Step 3: Generate TAN with ChipTAN procedure

Is the procedure now secure?

At first glance, everything looks great: You upload the data, check it once more, and then confirm it. But the devil is in the detail. But first, a bit of background: The ChipTAN procedure was introduced because mobile TANs have some fundamental problems: on the one hand, the TANs are sent over the unencrypted GSM network (Note: while GSM is encrypted, it can be cracked within seconds), and on the other hand, knowing a TAN is sufficient to perform any transfer. ChipTAN ChipTAN was intended to change this. Using a private key on the card, the core details of the transfer—amount and the recipient's account number—are to be entered using a non-compromised device (ChipTAN reader). By processing the data in the TAN, it should be ensured that any changes made in between are detected, thereby alerting the user if they, for example, have a virus in their system. What is problematic with the bulk transfer is the amount of data entered. Sparkasse only asks me for the total sum of all transfers as well as the number of items. For a fraudster, however, it hardly matters how many items and what sum is transferred. It even looks more plausible if a forged transfer transfers exactly the same amount as the original. The fraudster wants to swap the recipient IBANs with their own accounts. Although the money still needs to be laundered afterwards (it would be stupid if the account were in his name), that is not our problem at the moment.

What does the attack look like now?

The attacker must succeed in swapping the SEPA file so that the amount and the number of items remain the same, but the fraudster enters their own recipient IBANs. In the image shown above, "Step 1", the upload already takes place. Once the file is uploaded to the bank, it is too late for the fraudster. Therefore, he must intercept and modify the file before the upload. In "Step 2", the user sees the bookings listed once more. Since the fraudster has already had the modified files uploaded, the correctness of the data must continue to be feigned for the user. This is done by the fraudster using the swapped original data via a plugin in the web interface. The user is thus led to believe they are transferring money to the correct people. In Step 3 of the instructions, the fraudster no longer faces any difficulties, as the amount and number of items of the bulk order remain the same. In summary, the fraudster must develop a virus that injects a browser plugin into the system, which intercepts and replaces the upload, and replaces the displayed control data with the old data once again. Introducing the virus into a corporate network should not be a major hurdle and could be done, for example, using social engineering. The technically inexperienced business administration assistant is sent an email containing, for example, a reminder or an invoice. Since they are instructed to process invoices, it is quite likely that they will open the attachment.

How would one have to adapt the Sparkasse system?

The sticking point with bulk transfers is the integrity of the SEPA file. Instead of requesting the amount and the number of items during the ChipTAN entry, a checksum should be entered instead, which confirms that the SEPA file has not been altered. The user must calculate this checksum themselves. This does not sound very user-friendly. However, assuming that the users of SEPA files are rather consulting firms and tax offices and that the SEPA files are generated automatically, the software that generates the SEPA file can output the checksum at the same time. As a recommendation for a checksum procedure, I would suggest SHA-256 here. Simply by its use in Bitcoin and similar blockchains, thousands of gold diggers are familiar with trying to crack SHA-256. The fact that no one is harvesting Bitcoin blocks en masse proves that SHA-256 is extremely secure.

Why is the failure fatal?

What bothers me about the matter is that the Sparkasse pays so much attention to individual transfers and checks the amount and account number, even for the smallest amounts. When it comes to millions in salary payments, however, security is suddenly no longer guaranteed. In addition, many companies have a catastrophic security situation that practically invites scammers to compromise the network. Everywhere where multiple people serve as an entry point, security is weakened as a result. I don't know to what extent the Sparkasse will react to this. Reporting the matter to the Sparkasse first was not an option for me from the beginning. At the counter, I would have been looked at strangely, and direct contact with the security and IT department would have been too much research effort. Furthermore, in the past, there have been too many security researchers who, after reporting discreetly, were either ignored, dismissed with €25 vouchers, or even faced legal problems because their demand for a reward for finding the loophole was interpreted as extortion. Furthermore, I assume that no idiots work in Sparkasse IT. I think it's more likely that these security gaps were accepted for the sake of more user convenience. The decision ultimately comes from the top and not from the technical experts. The only question is at what loss amount it becomes worthwhile for the Sparkasse to invest in more security. However, the falsified SEPA files could also be blamed on the companies, which would mean the losses would fall on the Sparkasse's customers - thus, no need for action.

The problem goes even deeper

Assuming the computer is compromised and I generate my SEPA file from a program running on the compromised computer - then the entire security of the bank is useless. There are several ways the SEPA file can be created. On the one hand, an external party, such as the tax advisor, can create the SEPA file and send me the SHA256 sum via a secure method. Both parties would have to be infected, and the virus would have to be specifically tailored to the tax advisor's software to carry out the attack. But even if the SHA-256 sum was created on my compromised computer, one can specifically look at the economic viability of virus development: There are 3-4 common browsers, but hundreds of accounting programs, as well as thousands of individual solutions, that create SEPA files. If the banks were to do their duty, at least one risk factor would be eliminated.

Further design flaws of the ChipTAN procedure

While there are some other things that bother me about the ChipTAN procedure, I assume that the threat situation is quite manageable and that the Sparkasse will be held liable for its lack of security (to avoid provoking a scandal - legally they wouldn't have to be, as in many cases involving infected computers, it cannot be proven whether the user or the virus performed the action). Individual transfers are such a stumbling block: the amount and the account number are requested, but not the bank code (or the beginning of the IBAN). If I convince a bank to open an account that has the same account number as a payment recipient of my victim, I can easily replace the bank code of the transfer via a browser plugin and receive the money myself. The victim won't notice anything at first, as the account number and the amount are correct - only the recipient won't see their money. Another design flaw that lies much deeper is the key generation. I receive my EC card from the bank. The private key on the chip is not generated by me. Consequently, in the case of a confirmed transfer, either I or my bank would be the identifiable author. A TAN is therefore not definitive proof that a transfer is authorized by me, as it cannot rule out the bank as the signing party. This would only be possible if I were allowed to generate the key myself and burn it into the chip. Let's set aside the fact that this is not possible for usability reasons and that the chip-writing devices could also be compromised. This article is not intended as a reproach against Sparkasse alone. I can imagine that other banks make the same mistakes or that the banks are simply implementing standards (which they, of course, influenced themselves).

Conclusion

I hope that I will never have a virus that specializes in falsifying SEPA files. Otherwise, the financial consequences would be severe. I hope that, until Sparkasse has fixed the error, Linux is not yet so widespread that there are drive-by viruses that can cause havoc on my system. Should that happen, I will probably have to forgo bulk transfers and enter all items individually.
Categorias
Etiquetas