<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Artur Balsam</title>
    <description>The latest articles on Forem by Artur Balsam (@schreddies).</description>
    <link>https://forem.com/schreddies</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F571380%2Fff203079-f939-47f3-bfa5-c771e82066dd.jpeg</url>
      <title>Forem: Artur Balsam</title>
      <link>https://forem.com/schreddies</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/schreddies"/>
    <language>en</language>
    <item>
      <title>Make a thing</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Tue, 30 Jul 2024 18:25:51 +0000</pubDate>
      <link>https://forem.com/schreddies/make-a-thing-1ble</link>
      <guid>https://forem.com/schreddies/make-a-thing-1ble</guid>
      <description>&lt;h2&gt;
  
  
  Before
&lt;/h2&gt;

&lt;p&gt;In my university years, I was somehow involved in 3D printing, mostly through my friends and scientific association. That said, it has never caught on as a hobby; CAD softwares were quirky, printers were expensive, and were 'problematic to live with' types of device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now
&lt;/h2&gt;

&lt;p&gt;I've recently purchased a BambuLab p1s - enclosed type of fused deposition modeling printer, capable of printing multiple materials. Why Bambu? Why not Prusa? Being honest, the enclosed construction was deal breaker for me - minimising potentially dangerous fumes from printing was priority; coupled with &lt;a href="https://www.printables.com/model/272525-bentobox-v20-carbon-filter-for-bambu-lab-x1c-enclo" rel="noopener noreferrer"&gt;https://www.printables.com/model/272525-bentobox-v20-carbon-filter-for-bambu-lab-x1c-enclo&lt;/a&gt; and frequent room airing, I am less concern about my respiratory health. Also, BambuLabs are known for its low maintenance requirements. And design kind of match my home-office vibe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;Printing is easy, but creating your own designs? That's totally different story. I've tried several free tiers of CAD software, and fusion360 and Shapr3d are the best so far. Especially the second one, more welcoming learning path, using ipad with pen was much appreciated. But nevertheless, both softwares are expensive, and, for free tiers, have limitations. Shapr3d does not support round objects to be nicely exported to STL format, which is a bummer. And fusion is industry, not a hobbyist level (I admit some features, like generative design are extremely cool). My first creation, the airtag holder fitting under bike bottle cage, took me 10h trans Atlantic flight; from 0 experience to printable object with some design flaws.   &lt;/p&gt;

&lt;h2&gt;
  
  
  Solution. Sort of.
&lt;/h2&gt;

&lt;p&gt;Is it possible to write down physical object idea on your computer and within 1 hour get yourself an exact object on you desk? I am delighted to inform you that: it is fully possible, but it might be frustrating in the process. Especially if you are doing it without checking the design.&lt;/p&gt;

&lt;p&gt;As part of the task, I needed code-based CAD and I found one, probably the most popular out there - Openscad &lt;a href="https://openscad.org/" rel="noopener noreferrer"&gt;https://openscad.org/&lt;/a&gt;. It’s well known solution and definitely the learning curve is more gentle, but also not trivial, especially for more complex shapes.&lt;/p&gt;

&lt;p&gt;Combining openscad with most popular publicly available LLM, ChatGPT 4o, is quite simple. Without spinning any docker, feeding any data or using any knowledge for both subjects. Just free tier account, verbalised idea and lots of hope.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;using openscad create me a airtag holder, that have M5 screws mounting holes with 64mm between, and eliptic shape, with one side blind&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After 5 iterations, of me saying 'that's basically a sphere, not an airtag holder' and 'that won't fit an airtag', I got expected shape&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r911c3mqrxh9k2wzqsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r911c3mqrxh9k2wzqsi.png" alt="Image description" width="767" height="697"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrmqh418fwrcjpiyz23w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrmqh418fwrcjpiyz23w.png" alt="Image description" width="731" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j1lhnbp3yvoei6b5ccn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j1lhnbp3yvoei6b5ccn.png" alt="Image description" width="800" height="745"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After adding some features and more precise descriptions, forming kind of a list of features that needs to be incorporated to the final design, the LLM came up with following solution. Also I've hit pay-wall for free users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ftm2zf52uy8rh728mkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ftm2zf52uy8rh728mkg.png" alt="Image description" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Big remark: the objective of this activity was not to make any manual changes, as soon as shape was already matching my expectations - I've exported STL file. &lt;/p&gt;

&lt;h2&gt;
  
  
  Printing time
&lt;/h2&gt;

&lt;p&gt;The process of creating artificially made cad project, to create a real object, all within 1 hour, gives me chills and futuristic feel. I played 'Robot rock' by Daft Punk, and hit ‘printing’. Forty minutes later, AirTag holder was done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model review
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq035bdc6j03mgtdk7kfa.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq035bdc6j03mgtdk7kfa.JPG" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;br&gt;
As you can observe, even after few iterations, design is still flawed; namely a thickness of the walls included as part of inside compartment, not as outer body. That resulted in slightly bigger space for AirTag, which did not hold it securely and made a rattling noises. Also, whole design is not what you would call economically optimised (it's big), and not necessarily matching description (it's stadium shape, not elliptical). Despite these minor, easy to fix issues, the design was something that I had on my mind before starting. &lt;/p&gt;

&lt;p&gt;Here is a bonus, my design compared to LLM design. I've created lid for maximum weatherproofness, as well as some regions designed as empty space to reduce amount of material required. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoo2ny7odzgj268o4sbj.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoo2ny7odzgj268o4sbj.JPG" alt="Image description" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;I admit, my own CAD design is nice and functional, but LLM design isn't far off, especially with some minor adjustments. For normal, day-to-day functional prints, that might be pretty useful technique.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>OpenAPI/ChatGPT as security tool</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Wed, 07 Dec 2022 09:05:41 +0000</pubDate>
      <link>https://forem.com/schreddies/openapichatgpt-as-security-tool-4mjc</link>
      <guid>https://forem.com/schreddies/openapichatgpt-as-security-tool-4mjc</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Future is bright! Hopefully not from nuclear radiation. &lt;/p&gt;

&lt;p&gt;Recently the chatGPT emerged into the spotlight, everyone was trying to somehow use it. But what ChatGPT offers?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We’ve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There were some attempts to weaponize openai &lt;a href="https://twitter.com/lordx64/status/1598023663328014336" rel="noopener noreferrer"&gt;https://twitter.com/lordx64/status/1598023663328014336&lt;/a&gt;&lt;br&gt;
But my question would be - could we use it for product security?&lt;/p&gt;

&lt;p&gt;And answer is quick: yes, we can!&lt;/p&gt;

&lt;h2&gt;
  
  
  Idea
&lt;/h2&gt;

&lt;p&gt;Imagine having a simple problem, like in my previous post, Golang SQL Injection: &lt;a href="https://go.dev/doc/database/sql-injection" rel="noopener noreferrer"&gt;https://go.dev/doc/database/sql-injection&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's find out, what the ChatGPT thinks about these, two lines of code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpie6lwj3m915rpa3a1fz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpie6lwj3m915rpa3a1fz.png" alt="Image description" width="800" height="765"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we got interesting solution with information about security in your product. Think about it as OWASP Proactive Controls with OWASP Cheat Sheet, with Microsoft Paperclip communication skills. &lt;/p&gt;

&lt;p&gt;The only issue is that: proposed solution for vulnerable line of code from first question, would not fix the problem with SQL Injection. Instead of suggested solution, it should provide clear guidance, to construct db query, as in the second example.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;Yes, it's impressive and uncomfortable in the same time, especially in context of Terminator 2, that've recently watched.&lt;/p&gt;

&lt;p&gt;But let's make one thing clear, these information was already here. Using simple google search:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd9ae0oaip2zvu2qknfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffd9ae0oaip2zvu2qknfp.png" alt="Image description" width="800" height="250"&gt;&lt;/a&gt;. And these OWASP projects are available, for free, all the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Office_Assistant" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Office_Assistant&lt;/a&gt;&lt;br&gt;
&lt;a href="https://owasp.org/www-project-proactive-controls/" rel="noopener noreferrer"&gt;https://owasp.org/www-project-proactive-controls/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://cheatsheetseries.owasp.org/" rel="noopener noreferrer"&gt;https://cheatsheetseries.owasp.org/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://chat.openai.com/chat" rel="noopener noreferrer"&gt;https://chat.openai.com/chat&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;p&gt;Background picture generated by the DALL-E.&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>performance</category>
    </item>
    <item>
      <title>SAST Autofix</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Thu, 24 Nov 2022 22:55:53 +0000</pubDate>
      <link>https://forem.com/schreddies/sast-autofix-3kgb</link>
      <guid>https://forem.com/schreddies/sast-autofix-3kgb</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;I believe in automation. That's not very revealing, neither bold, statement, as for 2022. &lt;/p&gt;

&lt;p&gt;But most tooling from security world does not include any kind of automation, or, to make it worse, do it unnecessary complicated. Especially fixing findings from static application security testing tools (SAST), shouldn't be much of a hassle. After all, it is operating on finding the patterns, or exact matches in the code. &lt;/p&gt;

&lt;p&gt;That got me thinking: is it possible to make simple fixing rules. And I am delighted to say, I've found one! Without further due, the tool in question is: &lt;code&gt;sed&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Idea
&lt;/h2&gt;

&lt;p&gt;The high level idea is: in the CI/CD job, when vulnerable part of the code is found, the fix, if available, can be applied, and the vulnerability no longer exist in the code. And all that with simple sed command. &lt;/p&gt;

&lt;p&gt;If you do not recall what the sed is&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As it seems to be too good to be true - let's examine the functionality of the &lt;code&gt;sed&lt;/code&gt;, and how we could potentially used it against vulnerable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;sed&lt;/code&gt; with &lt;code&gt;s&lt;/code&gt; command, recognised as substitution, is able to change occurrences of matching regex into something else. &lt;/p&gt;

&lt;h3&gt;
  
  
  First: &lt;code&gt;s&lt;/code&gt; into &lt;code&gt;http&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Starting with simple &lt;code&gt;test.sh&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://internal.eks-asdf.com/asdf 
curl https://internal.eks-asdf.com/asdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's start with simple scenario: we would love to enforce all scripts to communicate, using &lt;code&gt;https&lt;/code&gt;, rather than &lt;code&gt;http&lt;/code&gt; to internal EKS address. To achieve that, we could embedded simple job, that changes all occurrences, in all, bash files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sed 's+http://internal.eks-asdf.com+https://internal.eks-asdf.com/asdf+g' test.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The sed command simply states, that &lt;code&gt;http://internal.eks-asdf.com&lt;/code&gt; should be replaced with &lt;code&gt;https://internal.eks-asdf.com/asdf&lt;/code&gt;, for all occurrences in file.&lt;/p&gt;

&lt;p&gt;As we could argue if this example is more associated with migrating from http to https (which is security 'thing'), the fact is, it worked. &lt;/p&gt;

&lt;h3&gt;
  
  
  Second: SQLi
&lt;/h3&gt;

&lt;p&gt;Going to more security related scenarios: using recommendation from the golang recommendation: &lt;a href="https://go.dev/doc/database/sql-injection" rel="noopener noreferrer"&gt;https://go.dev/doc/database/sql-injection&lt;/a&gt; we can use following rule to remove &lt;code&gt;fmt.Sprintf&lt;/code&gt; and change all &lt;code&gt;%s&lt;/code&gt; into &lt;code&gt;?&lt;/code&gt; - change assembly of statement as string into actual query.&lt;br&gt;
Having following part of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rows, err := db.Query(fmt.Sprintf("SELECT * FROM user WHERE id = %s", id))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And using our 'autofix':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sed 's+(fmt.Sprintf++g;s+%s+?+g;s+.$++g' test.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Command is combined: removing &lt;code&gt;(fmt.Sprintf&lt;/code&gt;, exchanging &lt;code&gt;%s&lt;/code&gt; with &lt;code&gt;?&lt;/code&gt; and removing last char &lt;code&gt;.$&lt;/code&gt; (which should be the latest &lt;code&gt;)&lt;/code&gt; character).&lt;/p&gt;

&lt;p&gt;We will end with that code, the output will be, valid, and working go sql query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rows, err := db.Query("SELECT * FROM user WHERE id = ?", id)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is way more approachable rule than I could imagine: it works for query with multiple parameters, it's self-explanatory, and make everything better. &lt;/p&gt;

&lt;h2&gt;
  
  
  Usability
&lt;/h2&gt;

&lt;p&gt;Is it possible to implement it user friendly way, into security job? Starting from beginning, &lt;code&gt;sed&lt;/code&gt; package can work with configuration file, called &lt;code&gt;Scripts&lt;/code&gt;, that stores multiple substitute commands. And it should be possible to write multiple rules for each language, with ease. &lt;/p&gt;

&lt;p&gt;Are presented 'rules' optimal? It depends, probably not, but the concept is very appealing to me - the opposite is to change it manually. Or not changing it at all.&lt;/p&gt;

&lt;p&gt;It is also very easy, to incorporate it as a job, into pipelines - it should be very appealing concept to everyone. &lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;I am not saying that you should ditch your sast tooling in the CI/CD pipelines, in favour of ‘sed’. Treat this post as proof of concept of ‘Autofix on cheap’. &lt;/p&gt;

&lt;h2&gt;
  
  
  Semgrep
&lt;/h2&gt;

&lt;p&gt;It's well thought SAST solution, with great 'user base' and amazing features, and one of them is the automated fixing of the vulnerabilities. It is in the experimental phase, so you can try it yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.nongnu.org/bibledit/sed_rules_reference.html" rel="noopener noreferrer"&gt;https://www.nongnu.org/bibledit/sed_rules_reference.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://semgrep.dev/docs/" rel="noopener noreferrer"&gt;https://semgrep.dev/docs/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>cpp</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Over Engineered Desk</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Thu, 15 Sep 2022 18:13:46 +0000</pubDate>
      <link>https://forem.com/schreddies/over-engineered-desk-1171</link>
      <guid>https://forem.com/schreddies/over-engineered-desk-1171</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;SAFETY DISCLAIMER&lt;/strong&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;As the security engineer I was aware of all potential security issues - and I still am now. But what’s far more concerning me is safety - for now there is no safety system to limit the crashing power of the desk, going down on something, or someone under the desk. And, in case of the Rise of the Machines, I am doomed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;During the pandemic I've bought myself a gift: Ikea Bekant. Purchase was made to make the 'working from home' experience bearable. Aaaand here we are - 2,5 years working like that. Why Bekant? No idea, probably it was available at that time and my wif... I like white colour. &lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;The only downside was the control panel: it was required to press one of two buttons, either 'up' or 'down' for the whole time, during changing height. No fixed position for standing or sitting - that's a shame. Or a perfect opportunity for a DIY project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution, hard way
&lt;/h2&gt;

&lt;p&gt;First thought, after a quick look at the desk frame, was to remove the control panel, and instead, put a microcontroller to communicate directly with motors. But as I was lacking an oscilloscope and any tools (my parents basement has it all) I needed a simpler solution. &lt;br&gt;
Some great solutions: &lt;a href="https://github.com/trainman419/bekant"&gt;https://github.com/trainman419/bekant&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.eevblog.com/forum/beginners/ikea-bekant-desk-motorised-hack/"&gt;https://www.eevblog.com/forum/beginners/ikea-bekant-desk-motorised-hack/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution, easy way
&lt;/h2&gt;

&lt;p&gt;Second thought: Emulate the buttons! To imitate the pilot, the GPIO ports should steer the buttons, with 'safety pin' connected directly to GND.&lt;/p&gt;

&lt;p&gt;As my Raspberry Pi zero was an overkill, not available and cold dead after another project, I've picked the old (7 years old to be precise) esp32 devkit. I've planned to do my master’s thesis using it, but... The connection is dead simple - three cables from 'pilot', esp32, micro usb cable, no fancy LEDs, no custom nor mechanical switches for operation. &lt;/p&gt;

&lt;p&gt;The esp32 was connected, using ingenious technique - male-to-male cables connected to the controllers' tape socket: GPIO22 to 'down', and GPIO23 to 'up' buttons, and safety pin to GND.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PhBmhkTJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toset8tdzmyqdayx8hob.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PhBmhkTJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toset8tdzmyqdayx8hob.jpeg" alt="Quick solution for tape socket" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2HWIYjO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecjr5dtfgktmi5kf9307.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2HWIYjO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecjr5dtfgktmi5kf9307.jpeg" alt="Beautifully crafted piece of engineering" width="880" height="1174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the instigation of my friend Piotr, I've used the Tasmota software, to integrate it with my not-so-smart home setup. Docker based Home Assistant, deployed on Orange Pi Zero 2 (that's some serious dev board!), paired with MQTT Broker Mosquitto as the brain of the system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7chnAYjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hd0c1zjhsabss61twkxo.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7chnAYjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hd0c1zjhsabss61twkxo.jpeg" alt="The mother board" width="880" height="1174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Automation - if the 'switch up' is on, set the pin high for N, where N is the empirically measured desk height for your height... in seconds, and then switch off the 'switch up'. Same with the low position. And thanks to Home Automation it was possible to set up the Siri integration. &lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;With all of that engineering, time, and around 30 USD, I can irritate my wife by saying 'Hey Siri, Office down/up' every time when changing position instead of holding the button for 13 seconds. &lt;/p&gt;

</description>
      <category>bekant</category>
      <category>iot</category>
      <category>workstations</category>
      <category>wfh</category>
    </item>
    <item>
      <title>PyScript XSS</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Mon, 16 May 2022 11:37:02 +0000</pubDate>
      <link>https://forem.com/schreddies/pyscript-xss-kp7</link>
      <guid>https://forem.com/schreddies/pyscript-xss-kp7</guid>
      <description>&lt;h1&gt;
  
  
  Run XSS in Your browser
&lt;/h1&gt;

&lt;h2&gt;
  
  
  With additional steps
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Last month Anaconda, release the PyScript &lt;a href="https://github.com/pyscript/pyscript" rel="noopener noreferrer"&gt;https://github.com/pyscript/pyscript&lt;/a&gt;. Simplifying: The Python in browser, with HTML and JavaScript. Javascript and python, in the browser,. What can possibly can go wrong. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;DISCLAIMER: It's fun post, pyscript is great idea, but as everything, security should be some concern. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  PyScript XSS
&lt;/h2&gt;

&lt;p&gt;Let's check how it works:&lt;br&gt;
index.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /&amp;gt;
        &amp;lt;script defer src="https://pyscript.net/alpha/pyscript.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;py-script src="/test.py"&amp;gt;&amp;lt;/py-script&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;test.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print('as&amp;lt;img src=x onerror=alert(1)&amp;gt;df')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and here we are, with XSS:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3bt6x74wpjzuslqksdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3bt6x74wpjzuslqksdl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;Make no mistake, The PyScript, is brilliant product! Just don't forget about security. &lt;/p&gt;

</description>
      <category>xss</category>
      <category>security</category>
      <category>python</category>
      <category>pyscript</category>
    </item>
    <item>
      <title>Security by incident and surprise </title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Sat, 25 Sep 2021 17:19:29 +0000</pubDate>
      <link>https://forem.com/schreddies/security-by-incident-and-surprise-2ijn</link>
      <guid>https://forem.com/schreddies/security-by-incident-and-surprise-2ijn</guid>
      <description>&lt;h3&gt;
  
  
  Story about weird and totally unplanned countermeasures for CSRF vulnerability that should not work
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Intro 1
&lt;/h2&gt;

&lt;p&gt;To properly reheat your pizza: turn on stove on the middle heating option. After putting pizza on a hot skillet, heat it for a few minutes. Then, add some water drops around pizza and put the lid on top and heat for a few more minutes. Done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proper intro
&lt;/h2&gt;

&lt;p&gt;Story of how I was stumbled, by a fairly simple non-vulnerable vulnerability. &lt;/p&gt;

&lt;h2&gt;
  
  
  What CSRF is
&lt;/h2&gt;

&lt;p&gt;Let's begin with CSRF definition from &lt;a href="https://owasp.org"&gt;OWASP&lt;/a&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Successful attacks consist of a user entering a malicious site (phishing), while being authenticated to a vulnerable application, which is without CSRF countermeasures (no token based mitigation: random value sent through hidden fields or headers). Underneath, malicious app calls, through the browser, using browsers’ automatic cookie sending, to the application in question. And this request, changes the state of the application ie. email change, or transfer funds. Or creates new users to internal system. When your GET request changes state (no judgement), CSRF is still possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What SOP and CORS is
&lt;/h2&gt;

&lt;p&gt;The Same-Origin Policy, known as SOP, is a browser mechanism that restricts how a document or script loaded by one origin can interact with a resource from another origin. Long story short, how one page can access data from other domains.&lt;/p&gt;

&lt;p&gt;CORS - is a mechanism, based on http headers, which allows the server to specify which domains, other than origin, should be allowed to load resources from apps. As the CORS is not simple, and many misunderstandings and misconfigurations were done over the years (even on apps that 'should know better'), it's good to get this knowledge!&lt;/p&gt;

&lt;p&gt;From this modest introduction, the question which is probably on your mind: &lt;code&gt;Why SOP and CORS, in CSRF of POST request&lt;/code&gt;? Why data protection mechanism in state-changing attack? Let me explain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things get serious, exploitation time
&lt;/h2&gt;

&lt;p&gt;Request to, CSRF suspected, endpoint looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt; POST /new-product HTTP/2
&lt;span class="err"&gt;#&lt;/span&gt; Host: vulnerableapp.com
&lt;span class="err"&gt;#&lt;/span&gt; Cookie: &amp;lt;removed&amp;gt;
&lt;span class="err"&gt;#&lt;/span&gt; User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
&lt;span class="err"&gt;#&lt;/span&gt; Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
&lt;span class="err"&gt;#&lt;/span&gt; Accept-Language: en-US,en;q=0.5
&lt;span class="err"&gt;#&lt;/span&gt; Accept-Encoding: gzip, deflate
&lt;span class="err"&gt;#&lt;/span&gt; Content-Type: application/json
&lt;span class="err"&gt;#&lt;/span&gt; Content-Length: 139
&lt;span class="err"&gt;#&lt;/span&gt; Origin: http://vulnerableapp.com
&lt;span class="err"&gt;#&lt;/span&gt; Referer: http://vulnerableapp.com/auth
&lt;span class="err"&gt;#&lt;/span&gt; 
&lt;span class="err"&gt;#&lt;/span&gt; {
&lt;span class="err"&gt;#&lt;/span&gt;   "name":"csrf",
&lt;span class="err"&gt;#&lt;/span&gt;   "size":"c",
&lt;span class="err"&gt;#&lt;/span&gt;   "active":true
&lt;span class="err"&gt;#&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is potentially perfect request: it has no countermeasures for CSRF and it make some changes by adding new product. And the response, &lt;code&gt;201 Created&lt;/code&gt; as expected. &lt;/p&gt;

&lt;h3&gt;
  
  
  First attempt
&lt;/h3&gt;

&lt;p&gt;CORS simple request (without preflight request) and POST request is allowed with three values of &lt;code&gt;Content-Type&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;application/x-www-form-urlencoded, &lt;/li&gt;
&lt;li&gt;multipart/form-data, &lt;/li&gt;
&lt;li&gt;text/plain
Any other value for this header, made by browser from page A to page B, will be preceded by 'preflight' CORS request - &lt;code&gt;OPTIONS&lt;/code&gt; method with &lt;code&gt;Access-Control-Request-Method&lt;/code&gt; and &lt;code&gt;Access-Control-Request-Headers&lt;/code&gt; headers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trying the same request but with SOPs' allowed &lt;code&gt;Content-Type&lt;/code&gt;, i.e. we can use &lt;code&gt;text/plain&lt;/code&gt; MIME type, in that case, we need to add the &lt;code&gt;=&lt;/code&gt; character to trick app to use equals sign as valid json.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt; POST /new-product HTTP/2
&lt;span class="err"&gt;#&lt;/span&gt; Host: vulnerableapp.com
&lt;span class="err"&gt;#&lt;/span&gt; Cookie: &amp;lt;removed&amp;gt;
&lt;span class="err"&gt;#&lt;/span&gt; User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
&lt;span class="err"&gt;#&lt;/span&gt; Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
&lt;span class="err"&gt;#&lt;/span&gt; Accept-Language: en-US,en;q=0.5
&lt;span class="err"&gt;#&lt;/span&gt; Accept-Encoding: gzip, deflate
&lt;span class="gd"&gt;- Content-Type: application/json
&lt;/span&gt;&lt;span class="gi"&gt;+ Content-Type: text/plain
&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt; Content-Length: 139
&lt;span class="err"&gt;#&lt;/span&gt; Origin: http://attacker.com
&lt;span class="err"&gt;#&lt;/span&gt; Referer: http://attacker.com/auth
&lt;span class="err"&gt;#&lt;/span&gt; 
&lt;span class="err"&gt;#&lt;/span&gt; {
&lt;span class="err"&gt;#&lt;/span&gt;   "name":"csrf",
&lt;span class="err"&gt;#&lt;/span&gt;   "size":"c",
&lt;span class="err"&gt;#&lt;/span&gt;   "active":true,
&lt;span class="gi"&gt;+   "trick=":"here"
&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unfortunately, no success - 500 error. From now on, it was clear that it won't be easy- the application is responding 500 error everytime when, even slight, there is change in request. &lt;/p&gt;

&lt;h3&gt;
  
  
  Second
&lt;/h3&gt;

&lt;p&gt;Another option is to use XHR and 'go with the flow' of CORS. Set the header &lt;code&gt;Content-Type&lt;/code&gt; with &lt;code&gt;xhr.setRequestHeader&lt;/code&gt; to &lt;code&gt;application/json&lt;/code&gt; and send the payload as it is. The only prerequisites are following response headers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt; Access-Control-Allow-Origin: https://www.attacker.com
&lt;span class="err"&gt;#&lt;/span&gt; Access-Control-Allow-Credentials: true 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And as it turns out CORS are wide open, with &lt;code&gt;Access-Control-Allow-Origin: *&lt;/code&gt;, which is worse in many scenarios. However in this case, no &lt;code&gt;Access-Control-Allow-Credentials&lt;/code&gt; header, and as result no credentials would be send to vulnerable page by browser. And, as a result, no CSRF.&lt;/p&gt;

&lt;h3&gt;
  
  
  Third: last but least
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If it looks stupid but works, it ain't stupid&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, it won't. But it's worth mentioning that the CORS standard allows browser, send requests with multiple values of the &lt;code&gt;Content-Type&lt;/code&gt; header. And it is against the RFC2616 14.17 (HTTP 1.1). Yet, It's perfectly fine for browser to send header like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt; Content-Type: text/plain; application/json
&lt;span class="err"&gt;#&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the server would only check if the value of headers contains &lt;code&gt;application/json&lt;/code&gt; as sub-string of the value - that would be a victory.&lt;/p&gt;

&lt;h2&gt;
  
  
  I LOST. Badly
&lt;/h2&gt;

&lt;p&gt;It should have been a walk in the park, but it wasn't. I was defeated by vulnerable applications, and I cannot even complain, that's impressive. If you have any ideas, how to bypass it (and help with my sleepless nights - it haunts me), please answer here: &lt;a href="https://security.stackexchange.com/questions/254895/secure-against-csrf-by-accident"&gt;https://security.stackexchange.com/questions/254895/secure-against-csrf-by-accident&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://owasp.org/www-community/attacks/csrf"&gt;https://owasp.org/www-community/attacks/csrf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest"&gt;https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy"&gt;https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS"&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://portswigger.net/web-security/csrf"&gt;https://portswigger.net/web-security/csrf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://datatracker.ietf.org/doc/html/rfc2616#section-14.17"&gt;https://datatracker.ietf.org/doc/html/rfc2616#section-14.17&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/TR/2020/SPSD-cors-20200602/"&gt;https://www.w3.org/TR/2020/SPSD-cors-20200602/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>csrf</category>
      <category>html</category>
      <category>appsec</category>
    </item>
    <item>
      <title>Authentication bypass in cryptography library</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Sat, 25 Sep 2021 17:17:42 +0000</pubDate>
      <link>https://forem.com/schreddies/authentication-bypass-in-cryptography-library-3bcp</link>
      <guid>https://forem.com/schreddies/authentication-bypass-in-cryptography-library-3bcp</guid>
      <description>&lt;p&gt;Post originally created on github.io on January 2021&lt;/p&gt;

&lt;h1&gt;
  
  
  Intro
&lt;/h1&gt;

&lt;p&gt;Vulnerability was found by the Synopsys CyRC researchers in the Bouncy Castle java library, in OpenBSDBcrypt class - see &lt;a href="https://www.synopsys.com/blogs/software-security/cve-2020-28052-bouncy-castle/"&gt;following article&lt;/a&gt; for more info from their side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;As it was already written in that post, the issue was with implementation method &lt;code&gt;doCheckPassword&lt;/code&gt;- method that checks password against a 60 character Bcrypt string. Let's dive into that and see what was the core issue and how it was fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Analysis
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Beginning
&lt;/h3&gt;

&lt;p&gt;In file &lt;code&gt;core/src/main/java/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java&lt;/code&gt; we can directly go to method &lt;code&gt;doCheckPassword&lt;/code&gt;, where we have couple major checks: whether the Bcrypt string is really Bcrypt string, and if cost factor is from proper range. Nothing special, nothing wrong, just &lt;code&gt;ifs&lt;/code&gt;. Relevant to our issue, line 268, states that only string with excatly 60 characters, will be analysed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sLength&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is nothing wrong with that statment but let's remember the number &lt;code&gt;60&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Then, in line 307, the Bcrypt hash &lt;code&gt;newBcryptString&lt;/code&gt; is generated from password and salt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;String newBcryptString = doGenerate(version, password, salt, cost);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, in following lines, created &lt;code&gt;newBcryptString&lt;/code&gt; is checked against the provided hash &lt;code&gt;bcryptString&lt;/code&gt;. And here we had vulnerability:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;        &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;isEqual&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sLength&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;newBcryptString&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;sLength&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;isEqual&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bcryptString&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;indexOf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;newBcryptString&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;indexOf&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isEqual&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In first line of code block there was declaration of a variable with primitive boolean, initialization with the &lt;code&gt;sLength&lt;/code&gt; value and comparison between it with an int value from length of &lt;code&gt;newBcryptString&lt;/code&gt;. The result should be true, as the freshly created hashed string is 60 char long.&lt;br&gt;
Then there is the &lt;code&gt;for&lt;/code&gt; loop, where the first interesting bit is the second statment, where the &lt;code&gt;sLength&lt;/code&gt; is used. As you migth remember: 60! So this loop is enumerating from 0 to 59, comparing the outcomes from &lt;code&gt;indexOf&lt;/code&gt; method of these two Bcrypt strings.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;code&gt;indexOf&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Now I would like to focus a little bit on the &lt;code&gt;indexOf&lt;/code&gt;. From the documentation: &lt;code&gt;Returns the index within this string of the first occurrence of the specified character.&lt;/code&gt;. In the code there is one parameter of the method &lt;code&gt;indexOf&lt;/code&gt;, and it is &lt;code&gt;i&lt;/code&gt; which basically is an integer in range from 0 to 59. In 34th iteration the following statment is checked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  isEqual &amp;amp;= (bcryptString.indexOf(33) == newBcryptString.indexOf(33));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you migth ask, what's the outcome? This operation is checking if index of first occurence of &lt;code&gt;!&lt;/code&gt; in both string is the same. Wait, what? Method overload with one parameter of &lt;code&gt;indexOf&lt;/code&gt; method makes &lt;code&gt;i&lt;/code&gt; treated as character in Unicode. In other words, this part of code checks if first occurance of unicode characters from 0 to 59 is the same for both strings. &lt;/p&gt;

&lt;h2&gt;
  
  
  Let's go back - Bcrypt
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node1.html"&gt;https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node1.html&lt;/a&gt;&lt;br&gt;
The Bcrypt is hash algorythm, based on the Blowfish cipher, intruduced in 1999. After 22 years it should be considered as secure (but is it &lt;a href="https://dl.acm.org/doi/10.5555/2671293.2671303"&gt;https://dl.acm.org/doi/10.5555/2671293.2671303&lt;/a&gt;) and is very popular when it comes to storing passwords. Not going into crypto details, this is how Bcrypt string looks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$2a$10$J4oVzGAgiyWfFqYbHINmbOyaq8NUYn60sRUWf1/Dm5GjkJDeVt/VS
|__|__|_____________________|______________________________|
ALG    SALT                  HASH  
   COST
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this issue however, interesting part is what kind of characters are allowed/possible in Bcrypt String. The answer comes from Bcrypt documentation: both strings the salt and hash are base64-encoded: alphanumeric, &lt;code&gt;+&lt;/code&gt; and &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unicode
&lt;/h2&gt;

&lt;p&gt;So what kind of characters we can get from 0 to 59? The answer is: some, but interesting for us are these:&lt;br&gt;
&lt;code&gt;36&lt;/code&gt; for &lt;code&gt;$&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;43&lt;/code&gt; for &lt;code&gt;+&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;47&lt;/code&gt; for &lt;code&gt;/&lt;/code&gt;,&lt;br&gt;
and range &lt;code&gt;48-57&lt;/code&gt; for the &lt;code&gt;0-9&lt;/code&gt; digits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Combine all of them together
&lt;/h2&gt;

&lt;p&gt;Combining the Bcrypt and Unicode characters could produce "colissions" on &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt; and digits range. According to article, around 20% passwords were checked positively in 1000 cases. For example this Bcrypt string &lt;code&gt;$2a$10$J4oVzGAgiyWfFqYbHINmbOyaq8NUYn60sRUWf1/Dm5Gj38DeVt/VS&lt;/code&gt; against that one &lt;code&gt;$2a$10$g4YFiQSjPuYvvg4NMwmwROjTB8ODmu6cKYigA1/i15XP38HXHq/ZK&lt;/code&gt; would be the same using this code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Mitigation
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;indexOf&lt;/code&gt; method was replaced with &lt;code&gt;charAt&lt;/code&gt;, which is way more suitable for checking if character in one string is same as in the other. &lt;/p&gt;

</description>
      <category>security</category>
      <category>appsec</category>
      <category>bcrpyt</category>
    </item>
    <item>
      <title>Secure by default, unsafe by you</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Sat, 25 Sep 2021 16:32:45 +0000</pubDate>
      <link>https://forem.com/schreddies/secure-by-default-unsafe-by-you-1gnn</link>
      <guid>https://forem.com/schreddies/secure-by-default-unsafe-by-you-1gnn</guid>
      <description>&lt;p&gt;Post originally created on github.io on October 2020&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimer
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;This post is the presentation of how to make code &lt;strong&gt;UNSAFE&lt;/strong&gt;. Please, do not use these code snippets in your application, unless you fancy to have a XSS. Read that, for extra protection: &lt;a href="https://owasp.org/www-community/xss-filter-evasion-cheatsheet"&gt;https://owasp.org/www-community/xss-filter-evasion-cheatsheet&lt;/a&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;In this small repo/blog will show you how to make modern, secure JS Frameworks, unsafe in nice way. Using purely these frameworks, we are going to end up with XSS. Following examples might be useful during code review or making a new version of DVWA, it’s up to you. Yes, you can find all these informations in the docs, but let's be honest - RTFM is not for everyone. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Overview: Brave New World of JavaScript
&lt;/h2&gt;

&lt;p&gt;Using this marvellous blog post &lt;a href="https://medium.com/javascript-scene/top-javascript-frameworks-and-topics-to-learn-in-2019-b4142f38df20"&gt;Top JS Frameworks 2019&lt;/a&gt; and followed by this awesome research &lt;a href="https://2019.stateofjs.com/front-end-frameworks/"&gt;State of JS 2019&lt;/a&gt; it’s naturally that that I’ve did research on following ones: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The most popular, the king: The ReactJS; &lt;/li&gt;
&lt;li&gt;The third, mr. lightweight Vue.js;&lt;/li&gt;
&lt;li&gt;I’ve also added Mithril, because why not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am planning do something similar to others also. Stay tunned&lt;/p&gt;

&lt;h3&gt;
  
  
  ReactJS
&lt;/h3&gt;

&lt;p&gt;Along with other possiblities of 'standard' XSS, this one using React DOM. Attribute called &lt;code&gt;dangerouslySetInnerHTML&lt;/code&gt; can be used to set HTMLdirectly form REACT. &lt;code&gt;dangerously&lt;/code&gt; part should suggest the user, that she/he doing something risky. In princple the DOM node will be updated with the object with key &lt;code&gt;_html&lt;/code&gt;, the HTML. And yes, I've seen this in the wild, with data suppiled by user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;dangerouslySetInnerHTML&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="na"&gt;__html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Not safe at all &amp;lt;img src=x onerror=alert(1)&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml"&gt;Documentation&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  VueJS
&lt;/h3&gt;

&lt;p&gt;Remember, the &lt;a href="https://portswigger.net/research/xss-without-html-client-side-template-injection-with-angularjs"&gt;Client side template injection with AngularJS&lt;/a&gt;? If not, I encourage you to do it right here, right now. In Angular 1.6.x, they removed whole sandbox thigh altogether, but last payload, from Sir Mario Heiderich&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;{{constructor.constructor('alert(1)')()}}&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 should bring our attention. Elegant, isn't it? And right now, it works on VueJS because of template possibility and mixing clientside and serverside rendering &lt;a href="https://github.com/dotboris/vuejs-serverside-template-xss"&gt;Great post with PoC on that&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Not&lt;/span&gt; &lt;span class="nx"&gt;great&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;terrible&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;alert(1)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)()}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://vuejs.org/v2/guide/security.html"&gt;Documentation&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mithril
&lt;/h3&gt;

&lt;p&gt;Starting from the &lt;a href="https://mithril.js.org/trust.html#avoid-trusting-html"&gt;middle&lt;/a&gt; the &lt;code&gt;m.trust&lt;/code&gt; should be avoidable, but if not, it can be dangerous, especially with user supplied data. Especially unsanitized data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;trust&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;h1&amp;gt;Here's some &amp;lt;img src=x onerror=alert(1)&amp;gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://mithril.js.org/trust.html"&gt;Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>appsec</category>
      <category>react</category>
      <category>mithril</category>
    </item>
    <item>
      <title>Corona Virus Threat Modelling</title>
      <dc:creator>Artur Balsam</dc:creator>
      <pubDate>Sat, 25 Sep 2021 16:19:50 +0000</pubDate>
      <link>https://forem.com/schreddies/corona-virus-threat-modelling-3jkn</link>
      <guid>https://forem.com/schreddies/corona-virus-threat-modelling-3jkn</guid>
      <description>&lt;p&gt;Post originally created on github.io on March 2020&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Well, we are doomed. And to add that, we are having the CORONA-19 virus around. Some of you might be familiar with the Threat Modelling in IT security but today I would like to make a Threat Modelling for your daily activity but with corona virus as main threat.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;DISCLIMER&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This post should NOT be treated as real measurement for preventing virus, neither it's a good representation of threat modelling of IT systems. This post reflects NONE medical value beside link to WHO. Treat it as mind puzzle.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DfMpBMxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqf4b2z5axs5b6wkkei6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DfMpBMxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqf4b2z5axs5b6wkkei6.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical intro
&lt;/h2&gt;

&lt;p&gt;For those, not familiar with Threat Modelling: it is the structured and continuous process of identifying security threats in the software. The definition is not really precise about, what kind of processes and techniques we should use, so let's free solo it!  &lt;/p&gt;

&lt;h3&gt;
  
  
  Story
&lt;/h3&gt;

&lt;p&gt;As you are in self-quarantine mode, but eating is quite essential, you need to get out and go out to nearest shop. Not favourite, nearest. To achieve goal of buying some pasta and tomatoes, you need to get from you flat, go thru corridor, ride elevator, walk 600m to nearest shop, buy stuff and survive on same way back.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Actors
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You,&lt;/li&gt;
&lt;li&gt;Unintentional attacker (person who is a carrier or sick, unintentional attacker in our puzzle),&lt;/li&gt;
&lt;li&gt;Intentional attacker (person who is not sick, but tries to, based on panic, gain something),&lt;/li&gt;
&lt;li&gt;Other people, &lt;/li&gt;
&lt;li&gt;Dogs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  'Technology' stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Human body - with a limited immune system (dependent on Multiple factors),&lt;/li&gt;
&lt;li&gt;CORONA-19 - easy spreading virus with the middle level of deadlines, &lt;/li&gt;
&lt;li&gt;Hand sanitizers, soap, water etc.,&lt;/li&gt;
&lt;li&gt;Door knobs, handles, baskets etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Environment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Corridor, &lt;/li&gt;
&lt;li&gt;The elevator, &lt;/li&gt;
&lt;li&gt;1,2 km way, &lt;/li&gt;
&lt;li&gt;Shop. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Threat Modelling
&lt;/h3&gt;

&lt;p&gt;As I am alone, I will guide you thru the story with marks, where the threats are. &lt;/p&gt;

&lt;p&gt;On the beginning, let's take a look on STRIDE, Microsoft methodology: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Spoofing - an attacker pretending to be someone else (unintentional attacker tries to look like healthy person) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tampering - attacker force user to perform action (make handshake, hug you) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Repudiation - attacker performing attack without being noticed/ proved (yup, it won't be easy to prove that, some sneaky sneeze etc.) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Information disclosure (privacy breach or data leak) - everyone, especially in Poland, wants to know your PESEL number, also intentional attackers  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Denial of a service - attack that will limit or disable your usability  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Elevation of the privilege - intentional attacker pretending to have access to data/ privilege to some action (all kind of phishing attacks for your data or virus trying to take over your immune system). &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clearly, we should divide these problems for two groups: the main about threats connected with the virus itself and the second, phishing or other activities. &lt;/p&gt;

&lt;p&gt;Getting out from flat to corridor should be safe, especially with face mask, only one handle form apartment door. And we have a first threat on our list, that might be pretty popular - door knob/ handle with virus on it. Then we need to pass one door from our neighbour (potential unintentional attacker), but we have a luck, no one is there - however we can think that meeting our beloved neighbourhood/friend/family member might give us threat number two - the physical contact with unintentional attacker. Next is the elevator, small area, without sufficient ventilation with little separation between people - obvious threat and increasing factor for unintentional attacker. On the way back we will use the stairs. Walk to the shop might not be as extreme as it seems, but we need to be careful on the cross walk, potential car hit might result in hospital care, which sure it's another threat for us - being in hospital during pandemic! In the shop we are putting pasta and tomatoes to small hand handled basket. Aaaand we have a next threat - similar to that one with door handle, make it as one: touching things. Also, in the shop there is more people than anywhere else in our scenario, the risk for getting sneezed by unintentional attacker increasing - so threat number two, meeting with unintentional attacker is having prime role here. You are paying - getting change in coins or bills triggers threat number one, paying with card or phone touch-less will minimalize it. If you have clean phone :). As you are environmentalist you have your own bag (from IT conference) and probably not taking the bill. On the way home you meet friendly dog, and thanks to WHO, we know, that consent belly rub for good boy is 100% safe for you and for him (in terms of COVID-19, make sure, that good boy is good boy). Next, getting your pin on pin pad (classified as door handle) and we are in staircase. A little bit of training and we are at our door. We have made it! But the phone is ringing and we are answering (with our dirty hands) - someone, that present herself as Sanitary - Epidemiological worker and tries to confirm our identity (threat number n). Now wash your hands, products that you bought and your phone! &lt;/p&gt;

&lt;h3&gt;
  
  
  Identified threats
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Getting contact with, potentially, virus contaminated surfaces, &lt;/li&gt;
&lt;li&gt;Physical contact with unintentional attacker, &lt;/li&gt;
&lt;li&gt;Sharing small closed area with others, &lt;/li&gt;
&lt;li&gt;Communication accident with high risk of hospitalisation, &lt;/li&gt;
&lt;li&gt;Staying unnecessary in crowded places, &lt;/li&gt;
&lt;li&gt;Phishing attempt. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Short walk for tomato gives you 6, quite obvious and general threats, but quite dangerous. Make something similar by yourself with your daily activities and see. &lt;/p&gt;

&lt;h3&gt;
  
  
  Recommendations
&lt;/h3&gt;

&lt;p&gt;But let's see how we can limit the risk: &lt;a href="https://www.who.int/health-topics/coronavirus#tab=tab_2"&gt;https://www.who.int/health-topics/coronavirus#tab=tab_2&lt;/a&gt; &lt;br&gt;
And about phishing: do not give any confidential information to person, whose identity cannot be proved.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Outro
&lt;/h2&gt;

&lt;p&gt;Read about Corona Virus from WHO pages. Stay strong and stay home! &lt;/p&gt;

</description>
      <category>security</category>
      <category>threatmodelling</category>
      <category>corona</category>
      <category>appsec</category>
    </item>
  </channel>
</rss>
