<?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>DEV Community: Dishebh Bhayana</title>
    <description>The latest articles on DEV Community by Dishebh Bhayana (@dishebh).</description>
    <link>https://dev.to/dishebh</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%2F243260%2F9d1f26ea-3850-4519-836d-93ffc2afbe3e.jpeg</url>
      <title>DEV Community: Dishebh Bhayana</title>
      <link>https://dev.to/dishebh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dishebh"/>
    <language>en</language>
    <item>
      <title>How I Took Over User Accounts Using Just Their Slack Member ID</title>
      <dc:creator>Dishebh Bhayana</dc:creator>
      <pubDate>Sat, 19 Jul 2025 18:56:39 +0000</pubDate>
      <link>https://dev.to/dishebh/how-i-took-over-user-accounts-using-just-their-slack-member-id-3kho</link>
      <guid>https://dev.to/dishebh/how-i-took-over-user-accounts-using-just-their-slack-member-id-3kho</guid>
      <description>&lt;p&gt;🔐 TL;DR – Slack Integration Account Takeover Vulnerability&lt;/p&gt;

&lt;p&gt;I discovered a critical vulnerability in a SaaS tool's Slack integration that allowed full account takeover using just a Slack Member ID.&lt;/p&gt;

&lt;p&gt;Exploit Chain:&lt;/p&gt;

&lt;p&gt;Convert Slack Member ID → Internal User ID&lt;/p&gt;

&lt;p&gt;Use Internal ID → Fetch Session Token&lt;/p&gt;

&lt;p&gt;Use Session Token → Get Bearer Tokens (access, refresh, id)&lt;/p&gt;

&lt;p&gt;This gave unauthorized access to any user’s account. I responsibly disclosed it to the team, and they acknowledged and patched it promptly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Discovery
&lt;/h2&gt;

&lt;p&gt;While exploring the Slack integration of a SaaS tool, I noticed something odd: I was able to get the access token for any user by just using their slack user id. &lt;/p&gt;

&lt;p&gt;In short, I could:&lt;/p&gt;

&lt;p&gt;Convert any Slack Member ID into the internal user ID&lt;/p&gt;

&lt;p&gt;Use that ID to fetch an authentication session token&lt;/p&gt;

&lt;p&gt;Exchange the session token for full bearer tokens&lt;/p&gt;

&lt;p&gt;With those, I had complete account takeover capability.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Exploit Chain
&lt;/h2&gt;

&lt;p&gt;Step 1 – Convert Slack Member ID to Internal User ID&lt;br&gt;
An API accepted a Slack Member ID and returned the associated internal user identifier.&lt;/p&gt;

&lt;p&gt;Step 2 – Use Internal ID to Fetch Session Token&lt;br&gt;
A second endpoint accepted the internal user ID and returned a session token.&lt;/p&gt;

&lt;p&gt;Step 3 – Use Session Token to Get Full Authentication Tokens&lt;br&gt;
The final endpoint accepted the session token and returned a complete set of bearer tokens: access_token, refresh_token, and id_token.&lt;/p&gt;

&lt;p&gt;This allowed me to take over any user’s account — view data, modify records, impersonate actions — all without their knowledge or consent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Responsible Disclosure
&lt;/h2&gt;

&lt;p&gt;I reported the issue privately to the team via email, along with a proof-of-concept video and clear reproduction steps. They acknowledged the issue promptly and patched it within days. I appreciated their transparent communication and quick resolution.&lt;/p&gt;

</description>
      <category>coding</category>
      <category>programming</category>
      <category>postman</category>
    </item>
    <item>
      <title>Email-First Medical Reporting for Rural Communities</title>
      <dc:creator>Dishebh Bhayana</dc:creator>
      <pubDate>Fri, 06 Jun 2025 14:09:37 +0000</pubDate>
      <link>https://dev.to/dishebh/email-first-medical-reporting-for-rural-communities-3ehh</link>
      <guid>https://dev.to/dishebh/email-first-medical-reporting-for-rural-communities-3ehh</guid>
      <description>&lt;p&gt;This is a submission for the &lt;a href="https://dev.to/challenges/postmark"&gt;Postmark Challenge: Inbox Innovators&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built a Rural Health Triage &amp;amp; Monitoring Dashboard that turns simple email messages into structured, actionable medical records — all powered by Postmark's inbound email stream.&lt;/p&gt;

&lt;p&gt;The core idea was to create a lightweight and accessible health reporting system for people in rural or underserved areas, where smartphone apps or internet connectivity may be limited — but basic email access still exists.&lt;/p&gt;

&lt;p&gt;Here’s how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Health workers or individuals send an email describing their symptoms and location to a designated email address.&lt;/li&gt;
&lt;li&gt;That email is captured via Postmark’s inbound webhooks, and a Node.js backend parses the request.&lt;/li&gt;
&lt;li&gt;The system analyzes the body of the email to extract symptom keywords and location data.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An automated follow-up email is sent using Postmark’s transactional stream, providing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A list of possible symptoms (based on keyword matching)&lt;/li&gt;
&lt;li&gt;First-aid guidance and health tips&lt;/li&gt;
&lt;li&gt;A list of nearby medical facilities (if any are found via OpenStreetMap)&lt;/li&gt;
&lt;li&gt;Important disclaimers to encourage professional consultation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The email is also stored in the system and displayed on a React-based dashboard that health administrators can access.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On the dashboard:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every medical email is logged as a clickable row in a records table.&lt;/li&gt;
&lt;li&gt;Clicking a record reveals full details: patient name (parsed from the email, if available), contact, symptoms, timestamp, reported location, and interaction history.&lt;/li&gt;
&lt;li&gt;Admins can assign cases to available healthcare workers using a dropdown menu.&lt;/li&gt;
&lt;li&gt;There’s also a secondary table that shows responders — people who have been assigned to past or current cases.&lt;/li&gt;
&lt;li&gt;The entire system is built with simplicity and usability in mind. No logins for reporters, no apps to install — just send an email, and the backend + Postmark handles the rest.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This project aims to bridge a real-world gap — using something as basic as email to connect patients and caregivers in low-connectivity regions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Video Link:&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/rOTYM8L7eqk"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;UI Dashboard link: &lt;a href="https://postmark-rural-health-frontend.vercel.app/" rel="noopener noreferrer"&gt;https://postmark-rural-health-frontend.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🧪 How to Test:&lt;br&gt;
&lt;strong&gt;Please use dummy name, disposable email, and dummy email address to test, since the information will be visible on the UI. Emails will still be masked (see the screenshots below for reference)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Send an email to: &lt;a href="mailto:694a9f34c5ea169b9bd9c053d783abc0@inbound.postmarkapp.com"&gt;694a9f34c5ea169b9bd9c053d783abc0@inbound.postmarkapp.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example email format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Subject: Urgent help needed!
Body:
Feeling nausea from morning, having stomach ache, and pain in muscles. Please help. I live at 121 Worcester Road Framingham MA 01701.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;While typing out the address, please try to avoid comma, as openstreet map sometimes doesn't parse the address correctly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You'll receive an automated response with symptom-specific health tips.&lt;/p&gt;

&lt;p&gt;The request will appear in the dashboard for medical volunteers to triage and track.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Repository
&lt;/h2&gt;

&lt;p&gt;The project is open-source and available on GitHub:&lt;br&gt;
🔗 &lt;a href="https://github.com/Dishebh/postmark-rural-health" rel="noopener noreferrer"&gt;https://github.com/Dishebh/postmark-rural-health&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The system is built around three core components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email ingestion backend&lt;/li&gt;
&lt;li&gt;Automated response system&lt;/li&gt;
&lt;li&gt;Triage dashboard UI
all stitched together with Supabase as the central data hub.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧰 Tech Stack&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚙️ Backend: Node.js + Express&lt;/li&gt;
&lt;li&gt;📬 Email Inbound/Outbound: Postmark (Inbound Webhooks + Transactional Stream)&lt;/li&gt;
&lt;li&gt;🗄️ Database: Supabase (PostgreSQL with Auth + RLS)&lt;/li&gt;
&lt;li&gt;💻 Frontend: React&lt;/li&gt;
&lt;li&gt;🗺️ Geolocation: OpenStreetMap + Haversine Formula&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📩 Email Intake &amp;amp; Parsing&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users (typically field workers or patients) send an email to a Postmark inbound address.&lt;/li&gt;
&lt;li&gt;The Node.js backend parses:

&lt;ul&gt;
&lt;li&gt;📌 Symptoms using keyword extraction from the body.&lt;/li&gt;
&lt;li&gt;📍 Location using pattern recognition from free-form address text.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Parsed data is inserted into the &lt;code&gt;medical_reports&lt;/code&gt; Supabase table for tracking.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Patient sending email:&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%2Fc5ynsj8c2s1y1g17b02i.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%2Fc5ynsj8c2s1y1g17b02i.png" alt="Patient sending email"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Patient received auto-generated email:&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%2F575ojuqvgw84wem36wj0.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%2F575ojuqvgw84wem36wj0.png" alt="Patient received auto-generated email:"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🧭 Location Processing &amp;amp; Facility Detection&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The backend uses a geocoding API to get coordinates from the raw address.&lt;/li&gt;
&lt;li&gt;Hospitals/clinics are fetched from OpenStreetMap.&lt;/li&gt;
&lt;li&gt;📐 Using the Haversine formula, the system calculates distances between patient and facility.&lt;/li&gt;
&lt;li&gt;🏥 The three nearest hospitals are selected and embedded in the auto-reply, along with clickable OSM links like:

&lt;ul&gt;
&lt;li&gt;In the above screenshots, the patient received the locations of nearby hospitals using openstreet map. For example - &lt;a href="https://www.openstreetmap.org/?mlat=50.8479749&amp;amp;mlon=-0.7799448&amp;amp;zoom=17&amp;amp;query=Nuffield%20Health%20Chichester%20Hospital" rel="noopener noreferrer"&gt;https://www.openstreetmap.org/?mlat=50.8479749&amp;amp;mlon=-0.7799448&amp;amp;zoom=17&amp;amp;query=Nuffield%20Health%20Chichester%20Hospital&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;📬 Auto-Reply System&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once the report is processed, the user gets a personalized health advisory via Postmark’s transactional stream.&lt;/li&gt;
&lt;li&gt;Email includes:

&lt;ul&gt;
&lt;li&gt;✅ Detected symptoms&lt;/li&gt;
&lt;li&gt;🩺 Immediate care tips&lt;/li&gt;
&lt;li&gt;🏥 Nearest medical facilities&lt;/li&gt;
&lt;li&gt;⚠️ Disclaimers about seeking urgent care if needed&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;All outbound emails are logged in an &lt;code&gt;auto_reply_emails&lt;/code&gt; table for reference.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Patient received auto-generated email:&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%2F575ojuqvgw84wem36wj0.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%2F575ojuqvgw84wem36wj0.png" alt="Patient received auto-generated email:"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🧑‍⚕️ Triage Dashboard UI&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend is built in React with a clean, table-driven interface.&lt;/li&gt;
&lt;li&gt;Displays all reports with sortable and clickable rows.&lt;/li&gt;
&lt;li&gt;On click, a side-drawer shows:

&lt;ul&gt;
&lt;li&gt;👤 Name&lt;/li&gt;
&lt;li&gt;📧 Email&lt;/li&gt;
&lt;li&gt;📝 Symptoms&lt;/li&gt;
&lt;li&gt;📍 Location&lt;/li&gt;
&lt;li&gt;🕒 Timestamp&lt;/li&gt;
&lt;li&gt;📚 Interaction timeline&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;A dropdown lets admins assign a &lt;code&gt;responder&lt;/code&gt; (stored in the responders table) to each report.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Table to show patient details received via their email:&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%2Fxxnnizdl1dqftccvhoi7.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%2Fxxnnizdl1dqftccvhoi7.png" alt="Table to show patient details received via their email"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please note that in above table, we also show an exclamation icon corresponding to patients that might require urgent help&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the patient opens up the details drawer:&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%2Fq5xutbcuj5g9c7h24js7.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%2Fq5xutbcuj5g9c7h24js7.png" alt="Clicking on the patient opens up the details drawer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see the auto-generated email for the patient in the UI:&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%2F4ao160v3rxgg91llz9na.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%2F4ao160v3rxgg91llz9na.png" alt="auto-generated email for the patient in the UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Responders table to create/manage a responder:&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%2F0rshin3qbrm7f298hqkk.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%2F0rshin3qbrm7f298hqkk.png" alt="Responders table to create/manage a responder"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🗃️ Supabase Schema&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;medical_reports&lt;/code&gt; – Stores incoming parsed email data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;responders&lt;/code&gt; – Contains healthcare volunteers/admin users&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;auto_reply_emails&lt;/code&gt; – Tracks the response messages sent out&lt;/li&gt;
&lt;/ul&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%2Fsxiflmgq4hd2kw8w37t1.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%2Fsxiflmgq4hd2kw8w37t1.png" alt="Supabase tables"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🐞 Challenges Faced&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🚫 Basic INSERT/UPDATE calls were silently failing — no server-side errors.&lt;/li&gt;
&lt;li&gt;💡 After hours of debugging, it turned out that Row-Level Security (RLS) was the culprit.&lt;/li&gt;
&lt;li&gt;🛡️ Fixed it by creating explicit policies for insert/update/delete tied to my service role — and then it all clicked.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>postmarkchallenge</category>
      <category>webdev</category>
      <category>api</category>
    </item>
  </channel>
</rss>
