<?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: Ladipo Samuel</title>
    <description>The latest articles on DEV Community by Ladipo Samuel (@ladipo_samuel_7cfaa827bf5).</description>
    <link>https://dev.to/ladipo_samuel_7cfaa827bf5</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%2F1667792%2F9b60d3c4-48b5-4943-a8e1-0c1e2da4b290.jpeg</url>
      <title>DEV Community: Ladipo Samuel</title>
      <link>https://dev.to/ladipo_samuel_7cfaa827bf5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ladipo_samuel_7cfaa827bf5"/>
    <language>en</language>
    <item>
      <title>Testing API Security with Cencori: A Case Study Using InsecurePay</title>
      <dc:creator>Ladipo Samuel</dc:creator>
      <pubDate>Fri, 03 Apr 2026 19:25:10 +0000</pubDate>
      <link>https://dev.to/ladipo_samuel_7cfaa827bf5/testing-api-security-with-cencori-a-case-study-using-insecurepay-2lae</link>
      <guid>https://dev.to/ladipo_samuel_7cfaa827bf5/testing-api-security-with-cencori-a-case-study-using-insecurepay-2lae</guid>
      <description>&lt;p&gt;Before running any security scans, I needed something meaningful to test. So I built &lt;strong&gt;InsecurePay&lt;/strong&gt;, a simple payment API designed to mirror real-world payment systems, but intentionally implemented with relaxed security.&lt;/p&gt;

&lt;p&gt;At its core, InsecurePay handles three main functions:&lt;/p&gt;

&lt;p&gt;Authentication — a basic login endpoint that returns a token&lt;br&gt;
Payments — an endpoint that processes card payments&lt;br&gt;
Transactions — an endpoint to view processed payments&lt;/p&gt;

&lt;p&gt;The project is built with Node.js and Express, and it follows a structure that reflects many real backend systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routes handle incoming requests&lt;/li&gt;
&lt;li&gt;Controllers manage the business logic&lt;/li&gt;
&lt;li&gt;A mock database simulates data storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How InsecurePay Works&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a user sends a payment request, the API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepts card details and payment information&lt;/li&gt;
&lt;li&gt;Simulates processing (no real payment gateway is used)&lt;/li&gt;
&lt;li&gt;Stores the transaction&lt;/li&gt;
&lt;li&gt;Returns a response containing the transaction details&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first glance, everything works as expected. You can log in, make a payment, and receive a successful response.&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%2F2h3ry87e6w4gxx6p6ftg.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%2F2h3ry87e6w4gxx6p6ftg.png" alt=" " width="800" height="342"&gt;&lt;/a&gt;&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%2F4r95ewyqlsq4h4qrns33.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%2F4r95ewyqlsq4h4qrns33.png" alt=" " width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, despite being functional, the API had some serious security concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensitive data like card numbers and CVV were exposed in responses&lt;/li&gt;
&lt;li&gt;Secrets were hardcoded directly into the codebase&lt;/li&gt;
&lt;li&gt;Critical routes, such as payments, lacked proper protection&lt;/li&gt;
&lt;li&gt;Logging exposed more information than necessary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these issues broke the application, but they violated basic security expectations. That was intentional.&lt;/p&gt;

&lt;p&gt;InsecurePay wasn’t designed to be perfect. It was built to reflect real-world flaws so they could be identified and addressed.&lt;/p&gt;

&lt;p&gt;At this point, I had a working API, but I already knew it wasn’t secure. So I decided to test it using &lt;strong&gt;Cencori Scan&lt;/strong&gt;, an AI-powered tool that detects security issues in codebases and suggests fixes. It can identify hardcoded secrets such as API keys and passwords, flag PII leaks like emails and card details, and detect vulnerable routes and unsafe coding practices.&lt;/p&gt;

&lt;p&gt;The goal was simple: could this tool detect real vulnerabilities in my project, and more importantly, help fix them?&lt;/p&gt;

&lt;p&gt;I ran the scan using:&lt;/p&gt;

&lt;p&gt;npx @cencori/scan&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%2Fisvxb93ha4ybdvqlyfwy.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%2Fisvxb93ha4ybdvqlyfwy.png" alt=" " width="427" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Results from the Scan&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%2F57bfmi29eikm6fu2x2ai.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%2F57bfmi29eikm6fu2x2ai.png" alt=" " width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cencori flagged several critical issues:&lt;/p&gt;

&lt;p&gt;Secrets in code — API keys and passwords were hardcoded&lt;br&gt;
PII exposure — card numbers, CVV, and emails were returned in responses&lt;br&gt;
Unprotected routes — sensitive endpoints lacked proper authorization checks&lt;br&gt;
Unsafe logging — request payloads exposed sensitive information&lt;/p&gt;

&lt;p&gt;While nothing broke, the security posture of the application was clearly weak.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fixing the Issues with Cencori&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I enabled Cencori’s auto-fix feature to address the problems more efficiently. To use Cencori Scan, you follow these steps:&lt;/p&gt;

&lt;p&gt;Step 1: Get an API key&lt;/p&gt;

&lt;p&gt;I generated a free API key from the dashboard and added it to my environment:&lt;/p&gt;

&lt;p&gt;$env:CENCORI_API_KEY="your_api_key_here"&lt;/p&gt;

&lt;p&gt;Step 2: Run auto-fix&lt;/p&gt;

&lt;p&gt;npx @cencori/scan --fix&lt;/p&gt;

&lt;p&gt;Cencori then analyzed each issue, suggested fixes, and updated parts of the code automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Changed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After reviewing the results, I made several important improvements:&lt;/p&gt;

&lt;p&gt;Moved secrets out of the codebase&lt;br&gt;
Added token-based protection to secure sensitive routes&lt;br&gt;
Removed sensitive fields such as card numbers and CVV from API responses&lt;br&gt;
Cleaned up unsafe logging practices&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%2Fl320a0p23xx5wy3x1gak.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%2Fl320a0p23xx5wy3x1gak.png" alt=" " width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some fixes were applied automatically, while others required careful review and manual adjustments, which is expected when working with security-critical systems.&lt;/p&gt;

&lt;p&gt;If you’re a developer who relies on AI to generate or automate parts of your code, tools like this become even more important. Cencori helps ensure that what gets produced isn’t just functional, but also secure. It acts as a safety layer, catching issues like exposed secrets, data leaks, and weak access controls before they make it into production.&lt;/p&gt;

&lt;p&gt;In a world where speed is becoming easier with AI, security should not be an afterthought. Cencori helps you maintain that balance between building fast and building safely.&lt;/p&gt;

&lt;p&gt;You can test it in your own project here:&lt;br&gt;
&lt;a href="https://cencori.com/" rel="noopener noreferrer"&gt;https://cencori.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also explore the InsecurePay project here:&lt;br&gt;
&lt;a href="https://github.com/ladicodes/InsecurePay-API" rel="noopener noreferrer"&gt;https://github.com/ladicodes/InsecurePay-API&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>backenddevelopment</category>
    </item>
  </channel>
</rss>
