<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Debipriya Kanjilal on Medium]]></title>
        <description><![CDATA[Stories by Debipriya Kanjilal on Medium]]></description>
        <link>https://medium.com/@meetglory?source=rss-60360a9273bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Debipriya Kanjilal on Medium</title>
            <link>https://medium.com/@meetglory?source=rss-60360a9273bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:06:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meetglory/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI-Augmented Legacy UI Modernisation: From Custom UI Archaeology to GenAI-Driven Code Generation]]></title>
            <link>https://medium.com/@meetglory/ai-augmented-legacy-ui-modernisation-from-custom-ui-archaeology-to-genai-driven-code-generation-8717540c6433?source=rss-60360a9273bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8717540c6433</guid>
            <category><![CDATA[gen-ai-tools]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[application-modernisation]]></category>
            <category><![CDATA[legacy-modernization]]></category>
            <dc:creator><![CDATA[Debipriya Kanjilal]]></dc:creator>
            <pubDate>Sun, 03 May 2026 14:58:01 GMT</pubDate>
            <atom:updated>2026-05-03T14:58:01.776Z</atom:updated>
            <content:encoded><![CDATA[<p>Modernizing legacy UI applications has always been one of the most underestimated challenges in enterprise engineering. Not because rewriting UI is technically difficult — but because <strong>understanding what already exists is</strong>.</p><p>In large organisations, legacy UI systems are rarely built on standard frameworks. More often, they are constructed on <strong>highly customised, niche frameworks</strong> — developed in-house, evolved over years, and barely documented. These systems embed business rules, UI behaviour, navigation logic, and backend integrations in ways that are deeply intertwined and difficult to untangle.</p><p>So the real question isn’t: <em>How do we rewrite this UI?</em><br>It’s: <em>How do we decode something that was never formally documented — and can GenAI help us do it at scale?</em></p><h3>The Shift: From Code Migration to AI-Assisted Knowledge Reconstruction</h3><p>A new pattern is emerging — one that reframes modernization not as a rewrite problem, but as a <strong>GenAI-driven knowledge reconstruction problem</strong>.</p><p>Instead of starting from scratch, we treat legacy code as a <strong>compressed, undocumented system of intent</strong>. GenAI becomes the layer that helps unpack, interpret, and restructure that intent — especially when dealing with <strong>custom UI frameworks that lack any formal reference material</strong>.</p><p>This introduces a powerful two-step model:</p><h3>1. Code-to-Spec: GenAI-Powered Custom UI Archaeology</h3><p>This is where GenAI delivers its most immediate value.</p><p>In many enterprises, legacy UIs are built on <strong>proprietary or niche frameworks</strong> — with:</p><ul><li>No official documentation</li><li>Non-standard component patterns</li><li>Embedded business logic inside UI layers</li><li>Custom navigation and state management mechanisms</li></ul><p>Traditional reverse engineering in such environments is slow and heavily dependent on SMEs. This is where <strong>GenAI changes the game</strong>.</p><p>By combining deterministic parsing (like AST extraction) with GenAI’s contextual reasoning, we can perform <strong>custom UI archaeology at scale</strong>.</p><p>The system extracts and reconstructs:</p><ul><li>UI structures — even when defined through custom abstractions</li><li>Navigation flows hidden within framework-specific constructs</li><li>Business rules embedded in UI event handlers</li><li>Backend integrations mapped through non-standard service layers</li><li>Configuration-driven behaviours and validations</li></ul><p>GenAI plays the role of a <strong>context-aware interpreter</strong>:</p><ul><li>It deciphers unfamiliar framework patterns</li><li>Connects fragmented logic across files</li><li>Translates low-level code into structured, human-readable artefacts</li></ul><p>But the real breakthrough is not just extraction — it’s <strong>how this information is organised</strong>.</p><p><strong>From Ingestion to Retrieval: Building a Queryable Knowledge Base-</strong></p><p>Before any code can be generated, the system must first <strong>understand and store the legacy application in a way that can be queried intelligently</strong>.</p><p>This happens through two key stages: <strong>Ingestion</strong> and <strong>Retrieval</strong>.</p><h3>Ingestion: Structuring the Unstructured</h3><p>The ingestion pipeline processes the legacy codebase and converts it into structured, machine-understandable artefacts.</p><p>This includes extracting:</p><ul><li>Abstract Syntax Trees (to represent code structure)</li><li>Navigation graphs (to map screen flows)</li><li>Business objects and logic mappings</li><li>Service invocation sequences</li><li>Configuration files, validations, and annotations</li></ul><p>These artefacts are then:</p><ol><li><strong>Chunked into smaller logical units</strong></li><li><strong>Converted into embeddings using GenAI models</strong></li><li><strong>Stored in a vector database</strong></li></ol><p>The result is a <strong>semantic knowledge base</strong> — a repository where every piece of the application is indexed not just by syntax, but by meaning.</p><p>This is particularly powerful for <strong>custom frameworks</strong>, where no formal documentation exists. The knowledge base effectively becomes the <strong>first structured documentation of the system</strong>.</p><h3>Retrieval: Turning Knowledge into Specifications</h3><p>Once the knowledge base is created, GenAI shifts from ingestion to <strong>intelligent retrieval</strong>.</p><p>Instead of scanning entire codebases, the system:</p><ul><li>Retrieves only the most relevant chunks based on a query</li><li>Uses prompt templates to generate specific artefacts</li><li>Produces structured outputs such as:</li><li>UI component definitions</li><li>Validation rules</li><li>API contracts</li><li>Business rules</li><li>User stories</li></ul><p>This is where GenAI acts as a <strong>specification generator</strong>, grounded in actual system behaviour.</p><p>Engineers can now query the system like:</p><ul><li><em>What are the validations for this field?</em></li><li><em>Which backend services are triggered by this screen?</em></li><li><em>What is the complete flow of this user journey?</em></li></ul><p>The result is a <strong>fully queryable, explainable representation of a previously opaque system</strong>. Prompt defining the outcome format of the userstory</p><h3>2. Spec-to-Code: GenAI-Driven Generation with Client-Specific Context</h3><p>Once the specifications are derived, the focus shifts to <strong>code generation — but not generic code generation</strong>.</p><p>Enterprise environments demand alignment with:</p><ul><li>Custom UI component libraries</li><li>Internal design systems</li><li>Organisation-specific coding standards</li><li>Predefined architectural patterns</li></ul><p>This is where GenAI becomes a <strong>context-aware engineering system</strong>.</p><p>Using the outputs from the retrieval process, along with additional inputs like:</p><ul><li>UI screenshots</li><li>Consolidated user stories</li><li>Design system documentation</li><li>Code skeletons</li></ul><p>GenAI orchestrates multiple specialised agents to generate code.</p><h3>Multi-Agent Chaining: Simulating Real Engineering Roles</h3><p>One of the most powerful techniques used is <strong>agent-based decomposition</strong>.</p><p>Instead of asking GenAI to do everything at once, the process is broken into <strong>sequential steps</strong>, where each step is handled by a specialised “agent”:</p><ul><li><strong>UX Agent</strong> → Interprets UI layout (from screenshots/wireframes)</li><li><strong>BA Agent</strong> → Structures user stories into rules and contracts</li><li><strong>Architecture Agent</strong> → Defines component hierarchy and design mapping</li><li><strong>Frontend Agent</strong> → Generates React components and state logic</li><li><strong>Validation Agent</strong> → Implements client-side validations</li><li><strong>Integration Agent</strong> → Builds API/service layers</li><li><strong>Utility Agent</strong> → Creates hooks, constants, enums</li><li><strong>Test Agent</strong> → Generates test cases</li></ul><p>Each agent:</p><ul><li>Receives <strong>focused context</strong></li><li>Produces <strong>bounded outputs</strong></li><li>Passes results to the next stage</li></ul><p>This chaining approach:</p><ul><li>Reduces cognitive load on the model</li><li>Improves accuracy for complex screens</li><li>Enables better control over output quality</li></ul><h3>How GenAI Adapts to Custom Libraries and Frameworks</h3><p>Unlike generic tools, this approach allows GenAI to:</p><h4>Map to Custom Components</h4><ul><li>Replace legacy UI elements with equivalents from the client’s design system</li><li>Prioritise reusable components over reinventing UI elements</li></ul><h4>Apply Enterprise Styling and Theming</h4><ul><li>Follow layout, spacing, and typography rules</li><li>Ensure visual consistency across generated screens</li></ul><h4>Use Internal Libraries and Patterns</h4><ul><li>Integrate with organisation-specific form handling, validation, and state management</li><li>Follow internal coding conventions and naming standards</li></ul><h4>Respect Custom Integration Models</h4><ul><li>Generate API layers aligned with internal contracts</li><li>Maintain consistency with backend communication patterns</li></ul><h3>Why This Matters: GenAI as an Enterprise Adaptation Layer</h3><p>The real power of this approach is not just speed — it’s <strong>adaptability to complexity</strong>.</p><ul><li>It enables understanding of <strong>undocumented, niche frameworks</strong></li><li>It transforms legacy systems into <strong>queryable knowledge assets</strong></li><li>It generates code that is <strong>aligned, not generic</strong></li></ul><p>In essence, GenAI becomes the bridge between:</p><p><strong>Unstructured legacy systems → Structured specifications → Enterprise-ready modern code</strong></p><h3>Final Thought</h3><p>Legacy systems — especially those built on custom, undocumented frameworks — have always been seen as barriers to change.</p><p>But with GenAI, they become <strong>discoverable, explainable, and transformable</strong>.</p><p>By combining <strong>knowledge base creation (ingestion + retrieval)</strong> with <strong>context-aware code generation</strong>, organisations can move beyond slow, manual modernisation toward a <strong>repeatable, intelligent transformation pipeline</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8717540c6433" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving CWE 117 with ESAPI and retaining log4j format]]></title>
            <link>https://medium.com/@meetglory/resolving-cwe-117-with-esapi-and-retaining-log4j-format-5a426a156164?source=rss-60360a9273bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a426a156164</guid>
            <dc:creator><![CDATA[Debipriya Kanjilal]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 16:26:04 GMT</pubDate>
            <atom:updated>2025-10-07T16:26:04.599Z</atom:updated>
            <content:encoded><![CDATA[<p>We all know that CWE 117 deals with the Improper Output Neutralization for Logs .It happens when user-controlled input (like request parameters, headers, or form data) gets written directly into logs without sanitization. Attackers can take advantage of sensitive information being written in the logs in the raw format . Example of a dangerous log:</p><p>logger.error(“Login failed for user: “ + username);</p><p>If username = “bob\nERROR: admin login failed”, then your logs show:</p><p>Login failed for user: bob<br>ERROR: admin login failed</p><p>Thus ESAPI helps in Contextual logging with EventType. Instead of just dumping strings, you log with a structured event type (EVENT_SUCCESS, EVENT_FAILURE, etc.).This separates attacker input from system-generated categories, making it harder to manipulate log meaning.<br>OWASP ESAPI supports SLF4J through its Slf4JLogFactory implementation, which allows applications using ESAPI to leverage their preferred logging framework by delegating ESAPI’s logging calls to a configured SLF4J provider like Logback,Log4J. But this does not happen by default.</p><p>ESAPI while printing the logs uses the SLF4j logger classes and prints the events along with the logs with the configured encoding format. But if you wish to use the standard log4j2 format with ESAPI , it needs some modifications. Even if you have imported your log4j2 jar and also mention the log4j specific packages in the ESAPI, it does not use the log4j2.xml. Specifically you have to override the Log4j2Logger and Log4j2LoggerFactory for ESAPI logging to fire the log4j2 properties.</p><p>When we do the following, then the standard SLF4j logger is referred</p><pre>package com.app.ui.util;<br><br>import ......<br><br>import org.owasp.esapi.ESAPI;<br>import org.owasp.esapi.Logger;<br><br><br>public class AppFilter implements Filter {<br> private static Logger logger = ESAPI.getLogger(MDCLoggingFilter.class);</pre><p>So to use the Log4j2 logger format we have to overrite the ESAPILogger , LogManager with the log4j implementation.</p><pre>import org.apache.logging.log4j.Level;<br>import org.apache.logging.log4j.Logger;<br>import org.owasp.esapi.ESAPI;<br>import java.util.Date;<br><br>public class Log4j2Logger implements org.owasp.esapi.Logger {<br> private final Logger logger;<br><br> public Log4j2Logger(Logger logger) {<br>  this.logger = logger;<br>  <br> }<br><br> private Level toLog4jLevel(int esapiLevel) {<br>        switch (esapiLevel) {<br>            case org.owasp.esapi.Logger.OFF: return Level.OFF;<br>            case org.owasp.esapi.Logger.FATAL: return Level.FATAL;<br>            case org.owasp.esapi.Logger.ERROR: return Level.ERROR;<br>            case org.owasp.esapi.Logger.WARNING: return Level.WARN;<br>            case org.owasp.esapi.Logger.INFO: return Level.INFO;<br>            case org.owasp.esapi.Logger.DEBUG: return Level.DEBUG;<br>            case org.owasp.esapi.Logger.TRACE: return Level.TRACE;<br>            default: return Level.INFO; // Default level<br>        }<br>    }<br>  private String format(EventType type, String message) {<br>         return &quot;[&quot; + new Date() + &quot;]  [&quot; + type.toString() + &quot;] &quot; + message;<br>     }<br> <br> public void log(int level, String event, String message) {<br>  logger.log(toLog4jLevel(level), ESAPI.encoder().encodeForHTML(message));<br> }<br><br> <br> public void log(int level, String event, String message, Throwable t) {<br>  logger.log(toLog4jLevel(level), ESAPI.encoder().encodeForHTML(message), t);<br> }<br><br> <br> @Override<br>    public void fatal(EventType type, String message, Throwable t) {<br>  log(FATAL, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void error(EventType type, String message) {<br>     log(ERROR, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void error(EventType type, String message, Throwable t) {<br>     log(ERROR, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void warning(EventType type, String message) {<br>     log(WARNING, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void warning(EventType type, String message, Throwable t) {<br>     log(WARNING, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void info(EventType type, String message) {<br>     log(INFO, type.toString(), message);<br>    }<br> <br>    @Override<br>    public void info(EventType type, String message, Throwable t) {<br>     log(INFO,format(type, message), message,t);<br>    }<br> <br>    @Override<br>    public void debug(EventType type, String message) {<br>        log(DEBUG,format(type, message), message);<br>    }<br> <br>    @Override<br>    public void debug(EventType type, String message, Throwable t) {<br>     log(DEBUG,format(type, message), message,t);<br>    }<br> <br>    @Override<br>    public void always(EventType type, String message) {<br>     log(INFO,format(type, message), message); // ESAPI &#39;always&#39; can be mapped to info or custom level<br>    }<br> <br>    @Override<br>    public void always(EventType type, String message, Throwable t) {<br>     log(INFO,format(type, message), message,t);<br>    }<br> <br>    // Log level checks<br>    @Override<br>    public boolean isDebugEnabled() {<br>        return logger.isDebugEnabled();<br>    }<br> <br>    @Override<br>    public boolean isInfoEnabled() {<br>        return logger.isInfoEnabled();<br>    }<br> <br>    @Override<br>    public boolean isWarningEnabled() {<br>        return logger.isWarnEnabled();<br>    }<br> <br>    @Override<br>    public boolean isErrorEnabled() {<br>        return logger.isErrorEnabled();<br>    }<br> <br>    @Override<br>    public boolean isFatalEnabled() {<br>        return logger.isFatalEnabled();<br>    }<br> <br>    @Override<br>    public boolean isTraceEnabled() {<br>        return logger.isTraceEnabled();<br>    }<br> <br>    <br><br> @Override<br> public void setLevel(int level) {<br>  // TODO Auto-generated method stub<br>  <br> }<br><br> @Override<br> public int getESAPILevel() {<br>  // TODO Auto-generated method stub<br>  return 0;<br> }<br><br> @Override<br> public void fatal(EventType type, String message) {<br>  log(FATAL,type.toString(), message);<br>  <br> }<br><br> @Override<br> public void trace(EventType type, String message) {<br>  log(TRACE,type.toString(), message);<br>  <br> }<br><br> @Override<br> public void trace(EventType type, String message, Throwable throwable) {<br>  log(TRACE,type.toString(), message,throwable);<br>  <br> }<br>}</pre><pre>package com.app.ui.esapi.logging;<br><br>import org.apache.logging.log4j.LogManager;<br>import org.owasp.esapi.LogFactory;<br><br>public class Log4j2LoggerFactory implements LogFactory {<br> @Override<br> public org.owasp.esapi.Logger getLogger(String moduleName) {<br>  return new Log4j2Logger(LogManager.getLogger(moduleName));<br> }<br><br> @Override<br> public org.owasp.esapi.Logger getLogger(Class clazz) {<br>  return new Log4j2Logger(LogManager.getLogger(clazz));<br> }<br>}</pre><p>Then add the Log4j2LoggerFactory in the ESAPI.properties.Following is a sample properties file</p><pre>Logger.LogEncodingRequired=false<br>Logger.UserInfo=false<br>Logger.ClientInfo=false<br>Logger.LogApplicationName=false<br>Logger.ApplicationName=flr-fastrakui<br>Logger.LogServerIP=false<br>ESAPI.Logger=com.app.ui.esapi.logging.Log4j2LoggerFactory<br>ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator<br>ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder<br><br>Encoder.AllowMultipleEncoding=false<br><br>Encoder.AllowMixedEncoding=false<br><br>Encoder.DefaultCodecList=HTMLEntityCodec,PercentCodec,JavaScriptCodec</pre><p>Once this is done the Logger will use the log4j format .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a426a156164" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>