{
    "componentChunkName": "component---src-templates-about-blog-template-js",
    "path": "/blogs/miert-fontos-az-api-biztonsag",
    "result": {"data":{"blog":{"content":"*A digitális átalakulás korában kiemelt szerepet kap az ügyfelek, a cégek és a partnerek közötti gyors kapcsolattartás és adatcsere. Ez a nyilvános API-k (Application Programming Interface-ek) számának robbanásszerű növekedését eredményezi. Az API-k olyan HTTP-alapú alkalmazásintegrációs protokollok amelyek elérhetővé teszik az alkalmazás adatokat a kapcsolódó felek, eszközök és szolgáltatások számára. Manapság az API-k több tízezer webes és felhőszolgáltatást, mobil- és IoT eszközt kötnek össze, és lehetővé teszik a zökkenőmentes gép-gép kommunikációt.*\n\nAz API-k már nem csak Facebook üzeneteket közvetítenek többé. Hatalmas mennyiségű érzékeny információ is továbbításra kerül ezeken az interfészeken: személyes azonosítók, pénzügyi és orvosi adatok, üzleti titkok, stb. És ezen adatok száma ugrásszerűen nő. Az API-k tehát közvetlen kiskapuként használhatók a vállalati rendszerekbe való bejutáshoz. Ennek eredményeként az API-infrastruktúrák elterjedése komoly biztonsági kihívásokat jelent. Ebben a posztban az API-kommunikáció biztonságával kapcsolatos legfontosabb szempontokat foglaljuk össze, és felvázolunk egy lehetséges megoldást.\n\n![miert-fontos-blog-1.png](/blog/miert-fontos-blog-1.png)\n\n## A támadók figyelme egyre inkább az API-kra összpontosul\n\nAz API-kon keresztül továbbított bizalmas adatok mennyisége gyors ütemben növekszik, ezáltal az API-k egyre inkább a támadók elsődleges célpontjává válnak. A sebezhető, hibás API-k felkutatásával képesek bejutni a bizalmas adatokat tároló háttérrendszerekbe. Ráadásul ezek a támadások egyre sikeresebbek. A közelmúltban történt nagyobb adatlopások közül sok esetben az API-k sebezhetőségét használták ki – gondoljunk csak a Salesforce.com, a T-Mobile, a Strava és az Egyesült Államok Postaszolgálatának esetére.\n\n## A hagyományos biztonsági megoldások nem nyújtanak megfelelő védelmet\n\nNapjainkban az API-támadások egyre összetettebbek, célzottabbak, amelyek könnyedén megkerülik a hagyományos védelmi rendszereket. Sajnos, a klasszikus webalkalmazás tűzfalak (WAF-ok), hitelesítő, tartalomszűrő illetve egyéb, alapszintű biztonsági eszközök NEM KÉPESEK az ilyen támadások észlelésére. A fejlett API-támadások csak célzott megoldásokkal akadályozhatók meg. Azok a vállalatok, amelyek nincsenek ezzel tisztában, hamis biztonságérzet mellett teszik kockára a központi rendszereiken tárolt adatokat.\n\n## Az API fejlesztők nem feltétlenül biztonság tudatosak\n\nA biztonság nem prioritás a legtöbb fejlesztési projektben: a fejlesztők a funkcionális specifikációra, a felhasználói élményre és a határidőkre koncentrálnak. Gyakran előfordul, hogy a biztonsági követelmények nincsenek is részletesen specifikálva. A biztonsági csapatoknak alig vagy egyáltalán nincs beleszólásuk az ilyen projektekbe. Ennek következtében a fejlesztők eszközkészlete és munkafolyamatai biztonsági szempontból nincsenek optimalizálva. A fejlesztők nem úgy gondolkodnak, mint a támadók. Mivel API sztenderdek nincsenek, ezért a biztonsággal sokszor csak 'best-effort' jelleggel foglalkoznak. Ez különlegesen sebezhetővé teszi a publikus API-kat, amely az üzletmenet számára kockázatokat, míg a rossz fiúk számára további lehetőségeket teremt.\n\n## A törvényi szabályozások biztonságos API-kommunikációt követelnek meg\n\nA PSD2 kötelezi a bankokat, hogy tegyék közvetlenül elérhetővé API-jaikat az online kereskedők és a külső fizetési szolgáltatók (TPP, fintech) számára. A GDPR közvetetten, de előírja a továbbított személyes adatok anonimizációját vagy pszeudo-anonimizációját. A PCI DSS kötelezi a pénzügyi szolgáltatókat, hogy a nyílt hozzáférésű hálózatokon titkosítsák a kártyatulajdonosi információkat, stb., stb... Az összes szabályozásnak egy közös, kulcsfontosságú követelménye van: a vállalatoknak gondoskodniuk kell az ügyféladatok biztonságáról azok tárolása és továbbítása során is. Ahhoz, hogy megfeleljenek ezeknek a feltételeknek, a szabályozott iparágaknak, mint például a pénzügyi, egészségügyi és állami szektornak, gondoskodniuk kell a nyilvános API-jaikon keresztül továbbított ügyféladatok védelméről.\n\n## Konklúzió\n\nÖsszegzésként elmondható, hogy számtalan API-alapú alkalmazás sebezhető. Napjainkra az ezeket a biztonsági réseket kihasználó támadások valódi fenyegetést jelentenek. Az API-támadások egyre összetettebbek és célzottabbak, és megkerülik a meglévő védelmi rendszereket. A nyilvános API-infrastruktúrát működtető szervezeteknek át kell értékelniük kockázati és megfelelőségi helyzetüket az API-k szempontjából. És itt nem csak a végfelhasználói vállalatokról van szó, az informatikai fejlesztőknek is gondolniuk kell az API-biztonság mélyebb szintű integrálására a projektjeikben. Az egyedi fejlesztésű alkalmazások biztonsági réseinek csökkentésével a hitelességüket és a jó hírüket is növelhetik.\n\n*A [Proxedo API Security](https://www.balasys.hu/hu/proxedo-api-security) egy speciális webes alkalmazás-tűzfal (WAF), amelyet az API-végpontok védelmére fejlesztettek ki. Egy rugalmas hálózatbiztonsági célmegoldás, amellyel szabályozhatja alkalmazásai adatforgalmát az API-támadások megelőzése érdekében. A Deep Packet Inspection (DPI) technológiának köszönhetően részletesen ellenőrizheti, titkosíthatja, és elemezheti az API forgalmát, mindezt kiegészítve egy szignatúra adatbázis-alapú védelemmel. Rugalmas architektúrájának köszönhetően vállalata kompromisszumok nélküli, egyedi API-biztonsági házirendet kényszeríthet ki. A Proxedo API Security kifejezetten az API-biztonságra összpontosít, így remekül kiegészíti a hagyományos WAF és API menedzsment eszközöket is.*\n","title":"Miért fontos az API-biztonság?","short_description":"A digitális átalakulás korában kiemelt szerepet kap az ügyfelek, a cégek és a partnerek közötti gyors kapcsolattartás és adatcsere.","author":"Gábor Marosvári, Product marketing lead, Balasys","date":"2021-02-02","hero":{"url":"https://balasysmediastorage.blob.core.windows.net/websiteimages/uploads/blog_header_2d283adf71.png"},"SEO":{"title":"Miért fontos az API-Biztonság?","isIndexable":true,"description":"Miért fontos az API-Biztonság?","keywords":"mi az API, API biztonság, api támadás, gdpr, psd2, pci dss","preview":null}},"related":{"nodes":[{"author":"Szilárd Pfeiffer","avatar":{"url":"https://balasysmediastorage.blob.core.windows.net/websiteimages/uploads/jievani_weerasinghe_NHRM_1u4_GD_A_unsplash_5998edbcc5.jpg"},"content":"**Researchers at **[Kudelski Security](https://kudelskisecurity.com/)** have **[managed to break](https://research.kudelskisecurity.com/2023/03/06/polynonce-a-tale-of-a-novel-ecdsa-attack-and-bitcoin-tears/)** Bitcoin and Ethereum wallets using a novel attack against one of the most popular asymmetric key algorithms of modern cryptography. Although **[Satoshi Nakamoto](https://en.wikipedia.org/wiki/Satoshi_Nakamoto)**’s wallet was not among the 764 wallets they were able to break, it is quite worrying to see that a software issue can make such a modern cryptographic algorithm like ECDSA vulnerable. Analysis of data that comes purely from open sources could reveal a practical weakness of an algorithm that is the fundamental basis of secure internet communication, public key infrastructures, and cryptocurrency transactions.**\n\n\n## Software Issue Behind the Scenes\n\nAs with many other times in the history of attacks against cryptographic algorithms, the cause of a successful attack is not a vulnerability in the algorithm itself, but the fact that poor-quality software used an algorithm with insufficient care. It is crucial to obtain “high-quality” random numbers during the calculation of many cryptographic operations. Such operations store passwords using [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))ed [hash](https://en.wikipedia.org/wiki/Cryptographic_hash_function)es, the generation of cryptographic keys used to authenticate web servers on the internet, or an employee before access is given to the company’s private network using a virtual private network (VPN) service. The generation of [digital signature](https://en.wikipedia.org/wiki/Digital_signature)s – which is necessary for the verification of the transactions – also requires a cryptographically strong random value. In the absence of strong random values, there would be a relation between the random and the private part of the signing key. This property could be exploited, and the private key can be acquired by an attacker. In the possession of the private key, any transaction related to the key can be verified, meaning that the balance of the wallet can be transferred.\n\n\n## Not a New Idea, but a New Method\n\nThough the attack itself is novel, the idea behind the attack is not so new. The lack of high-quality random numbers has caused serious vulnerabilities in the past. In 2002, a researcher found an [issue](https://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2008-0166) in the version of the [OpenSSL](https://www.openssl.org/) distributed with [Debian](https://www.debian.org/) Linux and its derivatives that reduced the entropy of generated random values. The issue caused SSH, VPN, and X.509 keys generated by the affected versions of OpenSSL to become vulnerable. Services still used a key generated by the affected version of the code which meant they remained vulnerable until the regeneration of the key. In 2010, a group called _fail0verflow _compromised an ECDSA key [Sony](https://en.wikipedia.org/wiki/Sony) used to sign software for the [PlayStation 3](https://en.wikipedia.org/wiki/PlayStation_3) game console. The root cause of the attack was almost the same as it is now, namely Sony did not use different random numbers when digitally signing different software. The novelty of the current attack is that it exploits the high-degree relationships among the random values ([nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce)s) used to generate digital signatures. It means if the nonce was not generated by a cryptographically secure random number generator but using a weak [pseudo-random number generator](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) (PRNG), it would allow the attacker to retrieve the private part of the key used to generate the signatures.\n\n\n## Special Kind of Open-source Intelligence\n\nThree prerequisites must be met to successfully retrieve the signer’s private key from signatures. The first one is that the random value used to generate the signature should come from a weak PRNG. The second one is to have a batch of consecutive digital signatures generated by using the same PRNG. The third one is that the signatures can be ordered, meaning that we know which signatures have been generated after which one. It could be assumed that there are implementations that use weak PRNGs as it is not basic knowledge whether random number generators are adequate for cryptographic purposes and some legacy software may follow older guidelines. The question is: where can an attacker find a consecutive and ordered list of signatures? The answer is: in several places. Digital signatures are part of each cryptographic protocol, so they can be collected from open sources. The best examples are [cryptocurrencies](https://en.wikipedia.org/wiki/Cryptocurrency), where the transfers are validated by digital signatures. These digital signatures must be published to allow each party to validate the transactions. Basically, cryptocurrency [blockchain](https://en.wikipedia.org/wiki/Blockchain)s are huge collections of the necessary signatures. For instance, researchers could collect 763 million unique signatures from the Bitcoin blockchain which were generated by 424 million unique public keys. Most of the time a key was used to generate only a few signatures, but millions of keys generated at least four signatures, which is the minimum requirement of the attack.\n\n\n## Someone Got Ahead of the Researchers\n\nResearchers ran their attack for two days and 19 hours with an estimated cost of USD 265, resulting in 762 unique broken wallets, but someone may have gotten ahead of them, as all the wallets had zero balance. The researchers suspect that these wallets have already been hacked in the past. If they had not been hacked, 484 BTC could have been stolen from these wallets, which means almost 12 million USD. However, 484 BTC was worth 31 million USD at Bitcoin’s peak. The question arises, where did the money go? The researchers obtained that the recipients were addressed by the latest transactions of the broken wallets. They identified 466 different recipient addresses, where the top 1 received 75 BTC, and the top 5 received 140 BTC, meaning more than USD 1.5 million, and almost USD 3 million, respectively. They counted 144 BTC in total, which is far from the theoretical 484 BTC, but it still sounds like a profitable business, worth the aforementioned USD 265 cost of the investigation. After the first transaction to the top address in 2018, several transactions were initiated from that address to several recipients for 0.5 or 1 BTC, although the account still had a balance of 63.5 BTC. Researchers also found public conversations about accounts that were swept exploiting repeated nonces. A forum member called _johoe_ [claimed](https://bitcointalk.org/index.php?topic=1431060.0) that he had collected 135 addresses that can be compromised using that technique, and 82 had been compromised already at the time of his post. He also stated that he collected 7 BTC from the broken accounts. He was willing to send the funds back to the owner after proving ownership. The researchers repeated their attack against Ethereum after collecting more than 1.7 billion ECDSA signatures. They managed to break 2 unique wallets processing 22% of their signature collection. They decided to stop the attack, considering that the cost-benefit ratio was too low.\n\n\n## Is This Still a Real Issue Now?\n\nConsidering only the results related to the Bitcoin wallets, I would say this might not be an issue anymore. The exploitable signatures were generated several years ago, perhaps with the same software that had a serious flaw, which may have already been fixed. The signatures were exploitable not because they used a pseudo-random generator during signature generation, but due to repeated nonce values. At the same time, given that digital signatures are used in so many cases, such as during a cryptographic handshake, this may still be a significant issue. Exploiting the vulnerability indeed requires getting consecutive signatures from a potentially affected server, which is not a trivial problem in the case of a busy server, as many other clients connect to a server between our consecutive connections. Even so, if an attacker manages to exploit a server, the server certificate is compromised without any sign on the server. For as much as the [certificate revocation is one of the weakest points of X.509](https://pfeifferszilard.hu/2020/09/09/why-do-certificate-revocation-checking-mechanisms-never-work.html), it is troubling that such a simple flow in an implementation can cause certificate compromise. The case would be even more worrying if there were a similar flow in certificate issuance, as this would compromise a CA, which could result in unpredictable consequences.\n\nPhoto by[ Jievani Weerasinghe](https://unsplash.com/@jievani?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on[ Unsplash](https://unsplash.com/photos/NHRM1u4GD_A?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)\n","date":"2023-03-16","id":"Blogposts_36","short_description":"Researchers at Kudelski Security have managed to break Bitcoin and Ethereum wallets using a novel attack against one of the most popular asymmetric key algorithms of modern cryptography, ECDSA.","slug":"bitcoin-account-hijacking-ecdsa-nonce-break","title":"Bitcoin account hijacking using OSINT techniques"},{"author":"Szilárd Pfeiffer","avatar":{"url":"https://balasysmediastorage.blob.core.windows.net/websiteimages/uploads/christian_lendl_Zytt_G_Su_o2_E_unsplash_76adf1b110.jpg"},"content":"**Quantum computing not only poses a great opportunity, but also a great threat to internet security. According to the promises of quantum computers, certain mathematical problems that form the basis of today’s most popular cryptographic algorithms will be much easier to solve with them than with classical computers. In a recent publication, Chinese researchers claim that there is an existing algorithm that, even with today's quantum computers, makes it possible to break the RSA algorithm, which is the fundamental basis of secure internet communication. At the same time, there are doubts about the reliability of the publication. However, even if these doubts are confirmed, it does not change the fact that the security threat posed by quantum computers remains with us.**\n\nThe basic claim of the [paper](https://arxiv.org/pdf/2212.12372.pdf), published last Christmas by 24 Chinese researchers, is that they have found an algorithm that enables 2,048-bit RSA keys to be broken even with the relatively low-power quantum computers available today. There is nothing really new in the fact that quantum computers pose a general risk to the reliability of cryptographic procedures that guarantee secure internet communications, such as [RSA open-key cryptography](https://en.wikipedia.org/wiki/RSA_(cryptosystem)) or the Diffie-Hellman key exchange algorithm. These procedures are based on mathematical problems that are practically unsolvable with conventional computers, but which can be solved in a few hours with sufficiently powerful quantum computers. Sufficiently large means 20 million [quantum bits](https://en.wikipedia.org/wiki/Qubit) (qubit) in this case. The problem with this figure of 20 million is that <span style=\"text-decoration:underline;\">IBM's quantum computer</span> – the largest quantum computer known today – can only render 433 of these 20 million qubits. It is not an exaggeration to say that the Chinese researchers chose one of the steepest hills to climb. But can they really overcome this challenge?\n\n> [Integer factorization](https://en.wikipedia.org/wiki/Integer_factorization) is the most widely used infeasible mathematical problem to guarantee that the cryptographic algorithms are practically unbreakable. Factorizing a number consisting of only a few digits is trivial (15 = 3 * 5), but the required computational capacity grows exponentially along with the number of digits. For hundreds or even thousands of digits, the computational effort required is so enormous that even using the highest performance supercomputers, the time required to do the calculation would be similar to the lifetime of the universe. According to the [recommendation](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf) of the [National Institute of Standards and Technology](https://en.wikipedia.org/wiki/National_Institute_of_Standards_and_Technology) (NIST), the smallest RSA key size that can be considered secure is 2,048 bits. This means approximately 600 digits, but in many cases larger keys of 3,072 or 4,096 bits are also used. There, the number of digits expressed in the decimal number system already exceeds a thousand, meaning that these keys are practically infeasible with traditional methods. At the same time, in 1994<span style=\"text-decoration:underline;\"> [Peter Shor](https://en.wikipedia.org/wiki/Peter_Shor)</span> already came up with an [algorithm](https://en.wikipedia.org/wiki/Shor%27s_algorithm) that – on a quantum computer only existing in theory at the time – would be able to perform the prime factorization with much greater efficiency than before. This breakthrough would imply that a significant part of our encryption procedures would no longer be resistant to breaking, including, among other things, HTTPS, which ensures the security of browsing, or VPN protocols, one of the foundations of remote work.\n\n## Has Cryptographic Apocalypse Now arrived?\n\nThe Chinese researchers could only provide a theoretical answer to this question, since the solution and the techniques outlined by them require a 372-qubit computer. Though this does exist within the walls of IBM,  the Chinese researchers did not have this machine at their disposal. However, they did succeed in factoring a 48-bit (15-digit) number with a 10-qubit computer. At first sight, this may not seem like much of a breakthrough, but it should be noted that this is the largest number that has ever been factored using a generic algorithm. Not to mention the fact that it was possible to put a theory into practice. The question is whether it was possible to bridge the aforementioned gap. As the correspondence between [Bruce Schneier](https://en.wikipedia.org/wiki/Bruce_Schneier) – one of the iconic figures of IT security – and [Roger A. Grimes](https://www.amazon.com/stores/Roger-A.-Grimes/author/B001IQUMT4) – the author of several books on cryptography – revealed:\n\n>“Apparently what happened is another guy who had previously announced he was able to break traditional asymmetric encryption using classical computers…but reviewers found a flaw in his algorithm and that guy had to retract his paper. But this Chinese team realized that the step that killed the whole thing could be solved by small quantum computers. So they tested and it worked.”\n\nYou might think that the cryptographic apocalypse is here.\n\n## Keep Calm and Dig Deep\n\nThe basis of the Chinese researchers’ algorithm relies on [Claus Schnorr](https://en.wikipedia.org/wiki/Claus_P._Schnorr)'s factorization algorithm (not to be confused with [Shor’s algorithm](https://en.wikipedia.org/wiki/Shor%27s_algorithm)). The aforementioned algorithm works well with smaller numbers – with which the researchers themselves tested it – but falls apart with larger values. It is precisely this limitation that the Chinese researchers claim to have overcome. However, they do not mention any details, and they have not been able to prove the complete theory in practice due to the lack of a quantum computer with sufficient capacity. As Schneier cited the situation on his blog:\n\n> “So if it’s true that the Chinese paper depends on this Schnorr technique that doesn’t scale, the techniques in this Chinese paper won’t scale, either. (On the other hand, if it does scale then I think it also breaks a bunch of lattice-based public-key cryptosystems.)”\n\nDoes the uncertainty remain until someone tries the algorithm on a sufficiently large-capacity quantum computer? Partially.\n\nThere are, in fact, some signs that cast doubt on the whole story. One of these is that the Chinese researchers failed to win the $200,000 prize offered by the [RSA Factoring Challenge](https://en.wikipedia.org/wiki/RSA_Factoring_Challenge), which goes to whoever can successfully crack a 2048-bit RSA key. Of course, you could say that they did not have the necessary hardware, but a letter to IBM to get the prize, even if it is shared, would have been certainly worthwhile. People drawn to conspiracy theories may ask why the Chinese state did not keep the discovery for itself and started pouring money into the development of a suitable quantum computer. This would obviously cost a very substantial amount, but would also bring a very substantial benefit. At the same time, there is also strong skepticism from the scientific side. [Scott Aaronson](https://en.wikipedia.org/wiki/Scott_Aaronson) – former researcher at MIT, now at the University of Texas – made a [devastating statement on his blog](https://scottaaronson.blog/?p=6957) about the Chinese paper. Aaronson, in his pieces of research, primarily focuses on quantum computing and complexity theory, perhaps the most important fields of science concerning our topic. His three-word review about the content of the publication was: “No. Just no.” He criticized the publication in a firm tone:\n\n\n> “Then, finally, they come clean about the one crucial point in a single sentence of the Conclusion section:\n> It should be pointed out that the quantum speedup of the algorithm is unclear due to the ambiguous convergence of QAOA.\n> “Unclear” is an understatement here. It seems to me that a miracle would be required for the approach here to yield any benefit at all, compared to just running the classical Schnorr’s algorithm on your laptop. And if the latter were able to break RSA, it would’ve already done so.\n> All told, this is one of the most actively misleading quantum computing papers I’ve seen in 25 years, and I’ve seen … many.”\n\nAaronson is not alone in his opinion: [many](https://www.linkedin.com/feed/update/urn:li:activity:7016808281847336960/) [others](https://www.linkedin.com/feed/update/urn:li:activity:7017366747691241472/) criticize the research on the same basis, including Peter Shor, who says:\n\n> “There are apparently possible problems with this paper.”\n\nIt should also be highlighted that the research-sharing platform ([arχiv](https://arxiv.org/)), where the Chinese study was published, [does not perform peer reviews](https://arxiv.org/about), meaning that the mere fact of publication does not mean much, especially in such popular fields as quantum computing and cryptography. \n\n## So, are we off the hook or not?\n\nEven if we are able to recognize all the [research paper mills](https://en.wikipedia.org/wiki/Research_paper_mill) – which must necessarily be expected in a popular and highly regarded discipline such as cryptography or quantum computing –  the harsh reality remains. Any encrypted data recorded today that uses a cryptographic process that does not withstand the challenges posed by quantum computers could become compromised in the not-too-distant future. As a result, it would be necessary to use algorithms that are thought to be secure against a cryptoanalytic attack by a quantum computer to mitigate the effect of the harvest-now-decrypt-later technique, as it cannot be eliminated. In the  case of a cryptographic problem that received great publicity, such as Heartbleed in 2014, the market reacted relatively quickly, although it was weeks before the error disappeared from the 100,000 most-visited pages. In other cases, which have not received as much publicity, it can take years, according to statistics from [Qualys Pulse](https://www.ssllabs.com/ssl-pulse/) . In other words, we cannot expect the introduction of post-quantum cryptography to happen much faster than this.\n\nThis is just like global warming: a problem that cannot be dealt with in the future when it becomes critical. It should be dealt with in the present. The similarity is striking if we consider the fact that scientists have been scaring people with horror stories about quantum computers for decades. What seemed like a theory for a while, has now become the reality. [IBM promises a one-thousand-qubit computer](https://www.science.org/content/article/ibm-promises-1000-qubit-quantum-computer-milestone-2023) by the end of the year, and [Google a one-million-qubit one](https://www.cnet.com/tech/computing/google-plans-to-build-a-practical-quantum-computer-by-2029-at-new-center/) by the end of the decade. The latter does not promise anything good, since it is only a question of data storage capacity – how much data can be accessed after RSA becomes breakable. The first to have machines with sufficient capacity will presumably be the still much-criticized technology giants, and the most powerful states. Lawmakers still call for encryption backdoors [from time](https://www.helpnetsecurity.com/2017/06/20/eu-encryption-law/) [to time](https://www.helpnetsecurity.com/2021/04/05/weak-encryption/), despite the [warnings](https://balasys.eu/blogs/weakened-encryption-is-a-silver-bullet-not-just-for-law-enforcement-agencies-but-for-cybercriminals) about the [serious risks involved](https://pfeifferszilard.hu/2021/02/25/cryptography-weakening-a-tale-of-the-law-abiding-criminal.html), but with such a technical breakthrough, they would not necessarily need to do so. However, this may have consequences that are difficult to foresee both for privacy and the outcomes of conflicts that are increasingly transferred to cyberspace.","date":"2023-02-20","id":"Blogposts_35","short_description":"In a recent publication, Chinese researchers claim that there is an existing algorithm that, even with today's quantum computers, makes it possible to break the RSA algorithm, which is the fundamental basis of secure internet communication. At the same time, there are doubts about the reliability of the publication.","slug":"chinese-researchers-rsa-is-breakable-others-do-not-panic","title":"Chinese researchers: RSA is breakable. Others: Do not panic! "},{"author":"László Horváth, Pre-Sales Engineer at Balasys","avatar":{"url":"https://balasysmediastorage.blob.core.windows.net/websiteimages/uploads/code_1839406_1280_48de8cd8f8.jpg"},"content":"*WAF-as-a-service solutions are becoming an increasingly popular method for protecting websites and services running in the cloud. One significant advantage is the vendors' claim that security settings can be updated in time based on the data from incoming attacks that are caught. However, the question arises: how effective and inevitable are current WAFs and WAF-as-a-service solutions?*\n\nIt is essential to address this issue as injection attacks are a prominent feature in the periodic OWASP Top 10 list, ranking 1st in 2013 and 2017 and 3rd in 2021, after broken access control and cryptographic failures. \n\n\n## Autospear: the new generation of SQL attacks \n\nAt the Black Hat Asia conference in May, researchers from Zhejiang University in China presented a new automated SQLi method for testing and bypassing signature-based WAFs. The method consists of using algorithms to modify the code originally intended to be injected – which is detected and blocked by firewalls by default – until it cannot be detected using the negative security model. \n\nThe modifications were as follows: \n\n| MODIFICATION  | EXAMPLE  |\n| ---  | ---  |\n| Case Swapping  | or 1 = 1 → oR 1 = 1  |\n| Whitespace Substitution  | or 1 = 1 → \\tor1\\n=1  |\n| Comment Injection  | or 1 = 1 → /\\*foo\\*/or 1 =/\\*bar\\*/1  |\n| Comment Rewriting  | /\\*foo\\*/or 1 = 1 → /\\*1.png\\*/or 1 = 1  |\n| Integer Encoding  | or 1 = 1 → or 0x1 = 1  |\n| Operator Swapping  | or 1 = 1 → or 1 like 1  |\n| Logical Invariant  | or 1 = 1 → or 1 = 1 and 'a' = 'a'  |\n| Inline Comment  | or 1 = 1 → /\\*!or/ 1 = 1<br>union select → /\\*!union\\*/ /\\*!50000select\\*/  |\n| Where Rewriting  | where xxx → where xxx and True<br>where xxx → where (select 0) or xxx  |\n| DML Substitution  | or 1 = 1 → \\|\\| 1 = 1 <br>and name = 'foo‘ → && name = 'foo'  |\n| Tautology Substitution  | 1 = 1 → ‘foo’ = ‘foo’<br>‘1’ = ‘1‘ → 2 <> 3 <br>1 = 1 → (select ord(’r’) regexp 114) = 0x1  |\n\nThe point of the modifications, in this case, is that the SQL command will not change semantically, and the database server will be able to process it, but the signature-based protection can be bypassed. To do this, an algorithm is used that systematically maps which modifications can be run by trial and error and uses the feedback to design the code for the final attack. \n\nThe researchers tested the method on seven popular web application firewalls, four of which are available on Amazon Web Services as WAF-as-a-service. They focused on four types of requests (GET / GET(JSON) / POST / POST(JSON) and generated 10,000 unique codes from 100 known SQLi expressions. \n\nThe results suggest that WAF-as-a-service solutions can be attacked with high effectiveness, as there were vendors with 89% or more success using JSON payload. \n \n\n## Positive security model: protection against Autospear and other attacks\n\nThe positive security model has often been criticized for being more time-consuming and complex – and therefore more costly – to develop than the signature-based model. Still, it can provide much more effective protection against Autospear and similar attacks. With a properly designed and maintained API schema, the acceptable incoming data in a given field can be limited to the point where any modification that does not contain the expected data will immediately block the call. For example, in a userid field, you can specify precisely where and what characters are expected, their length, and composition. \n\nThis takes time and expertise, and needs to be tailored to the specific API in each case. It is not a switch that, when flipped, can give a false sense of security that you are protected against OWASP Top10 vulnerabilities. \n\nAnother severe criticism is that the positive security model gives too many false positives, though this problem can be avoided using expert-created and maintained templates and continuous feedback during testing. \n\nHowever, a proper API security solution can help you to build your positive security model effectively. It is essential to ensure proper logging is in place during the development and testing phase. This can help you picture what your core traffic consists of and what vulnerabilities exist. A positive security model also enables you to test existing – or possibly missing – traffic-based schemes under controlled conditions. You can provide appropriate feedback to your developers by filtering out any calls that may occur that do not conform to the scheme. This can be recorded in log files in a developer environment with accurate feedback without interrupting the call. In a live system, you can immediately cut off the call without feedback or send a misleading message to the attacker. ","date":"2022-11-30","id":"Blogposts_33","short_description":"Web Application Firewalls (WAFs) are widely used to protect websites and APIs against various attacks, such as SQL injection (SQLi) and cross-site-scripting (XSS). ","slug":"weaknesses-of-signature-based-api-protection","title":"Weaknesses of signature-based API protection"}]}},"pageContext":{"slug":"miert-fontos-az-api-biztonsag"}},
    "staticQueryHashes": ["3233329270","3621970722","521397250","585144119"]}