Fluig Validate Security logo

Fluig Validate Security

Organization
totvs
fluig-validate-security

Sanitiza entradas e previne vulnerabilidades de frontend Fluig (XSS, innerHTML inseguro, eval/new Function com dados dinâmicos, escape FreeMarker ?html/?js_string, cuidado com Mustache triple-stache {{{ }}}, acesso a rota interna não documentada do Fluig) usando as APIs públicas WCMAPI.validateXSS (API oficial de alto nível, que internamente usa FLUIGC.utilities.preventXSS) e DOMPurify.sanitize. Use quando precisar validar/sanitizar código client-side de customização que manipula entrada do usuário no DOM, na persistência ou na exibição.

Overview

Publishertotvs
Repositoryfluig-agent-skills
Skill namefluig-validate-security
Stars
37
Forks
14
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by totvs on GitHub. Read the source before you install it.

Installation

Install the Fluig Validate Security AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/totvs/fluig-agent-skills/tree/main/skills/fluig-validate-security
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/totvs/fluig-agent-skills.git /tmp/fluig-agent-skills
mkdir -p .claude/skills
cp -r /tmp/fluig-agent-skills/skills/fluig-validate-security .claude/skills/fluig-validate-security
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fluig Validate Security in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fluig Validate Security on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fluig Validate Security is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Validação de Segurança (Sanitização e Prevenção de XSS)

Esta skill sanitiza entradas e previne vulnerabilidades no frontend de customização Fluig; ela não duplica convenções — o arquivo de context/ é a fonte de verdade, referenciada abaixo.

Passo 0 — Persona

Antes de validar/sanitizar, classifique a persona do desenvolvedor seguindo a cascata em persona-routing.md: conversa > marcador de arquivo > marcador técnico de Store (component.xml ou API de slot)

estrutura do projeto > pergunta. Se restar ambígua, pare e pergunte antes de continuar. Emita Persona: <Parceiro|Consultor> (motivo) — as regras de sanitização são invioláveis para ambas as personas (não há camada da Store nesta skill).

Objetivo

Com responsabilidade única, sanitizar entradas e prevenir vulnerabilidades no frontend de customização Fluig (XSS, uso inseguro de innerHTML, eval()/new Function() com dados dinâmicos, interpolações sem escape em FreeMarker, uso de Mustache triple-stache {{{ }}} sem sanitização e acesso a rota interna não documentada do Fluig), aplicando exclusivamente as APIs públicas e oficiais — preservando o comportamento do código.

Quando Usar

  • Ao manipular entrada do usuário que será inserida no DOM, persistida ou exibida.
  • Quando o código usa innerHTML com conteúdo derivado de dados do usuário.
  • Quando há eval()/new Function() recebendo dados dinâmicos.
  • Quando dados dinâmicos são interpolados em templates FreeMarker sem escape.
  • Quando o código renderiza HTML via Mustache com triple-stache {{{ }}} (ou {{& }}), que desabilita o escape automático.
  • Ao fazer chamadas REST ao domínio do próprio Fluig, que deve usar API pública com URL via WCMAPI.getServerURL() (nunca uma rota interna não documentada, ex.: /ecm/api/rest/ direto) → ver platform-constitution.md.
  • Antes de enviar (POST/PUT) ou ao receber/exibir (GET) dados do usuário.

Entradas Esperadas

EntradaDescriçãoObrigatória
Código alvoTrecho de frontend (JS de widget/Custom Element, FreeMarker) a validar/sanitizarsim
Origem dos dados do usuárioDe onde vêm os dados não confiáveis (formulário, query string, resposta de API, parâmetros)não

Contexto de Referência (Fonte de Verdade)

Leia antes de executar — não reproduza o conteúdo aqui:

  • conventions.md — seção Segurança (APIs públicas): WCMAPI.validateXSS(data, replace) como API oficial (reduz a texto puro; internamente usa FLUIGC.utilities.preventXSS, que não é depreciado) e DOMPurify.sanitize (mantém HTML válido), textContent vs innerHTML, escape FreeMarker (${value?html}, ${value?js_string}), cautela com o triple-stache {{{ }}} do Mustache, proibição de eval()/new Function() e sanitização na entrada e na exibição.
  • conventions.md — seção Chamadas REST e Integrações: fetch() + async/await + try/catch para qualquer chamada; o domínio do próprio Fluig só por API pública, com a URL montada a partir de WCMAPI.getServerURL() — nunca uma rota interna não documentada.

Regras Aplicáveis (Resumo Executivo)

Somente o mínimo para orientar a tarefa; o detalhe está no contexto:

  • Tratar toda entrada do usuário como não confiável antes de qualquer uso no DOM ou persistência → ver conventions.md.
  • Sanitizar com DOMPurify.sanitize quando precisar manter HTML válido sem código malicioso → ver conventions.md.
  • Sanitizar com WCMAPI.validateXSS quando quiser converter o valor em texto puro (elimina XSS) → ver conventions.md.
  • Preferir textContent a innerHTML; só usar innerHTML com conteúdo já sanitizado por DOMPurify.sanitize → ver conventions.md.
  • Escapar dados dinâmicos em FreeMarker: ${value?html} (e ${value?js_string} para JS inline) → ver conventions.md.
  • Usar Mustache triple-stache {{{ }}} (ou {{& }}) apenas com conteúdo já sanitizado por DOMPurify, pois ele desabilita o escape automático → ver conventions.md.
  • Nunca usar eval() nem new Function() com dados dinâmicos → ver conventions.md.
  • Para o domínio do próprio Fluig, usar sempre a API pública, com a URL montada a partir de WCMAPI.getServerURL() — nunca uma rota interna não documentada → ver platform-constitution.md.
  • Sanitizar tanto na entrada (POST/PUT) quanto na exibição (GET) → ver conventions.md.

Procedimento

  1. Localizar os pontos onde entrada do usuário entra no DOM, na persistência ou na exibição (atribuições a innerHTML, interpolações FreeMarker, chamadas dinâmicas).
  2. Aplicar a sanitização adequada com a API pública correta: DOMPurify.sanitize para preservar HTML válido; WCMAPI.validateXSS para reduzir a texto puro.
  3. Substituir usos inseguros de innerHTML por textContent (quando texto basta) ou por conteúdo sanitizado com DOMPurify.sanitize.
  4. Escapar dados dinâmicos em FreeMarker com ${value?html} (e ${value?js_string} em contexto JS inline); ao usar Mustache, garantir que conteúdo em triple-stache {{{ }}} esteja previamente sanitizado por DOMPurify.
  5. Remover eval()/new Function() que recebam dados dinâmicos, substituindo por lógica explícita e segura.
  6. Garantir que chamadas ao domínio do próprio Fluig usem a API pública, com a URL montada a partir de WCMAPI.getServerURL() — nunca uma rota interna não documentada.
  7. Garantir sanitização na entrada e na exibição dos dados do usuário.
  8. Validar o resultado com o checklist abaixo, confirmando que o comportamento foi preservado.

Saída Esperada

Código com:

  • Entradas do usuário sanitizadas via APIs públicas (DOMPurify.sanitize e/ou WCMAPI.validateXSS).
  • Sem vetores de XSS: sem innerHTML inseguro, sem eval()/new Function() com dados dinâmicos e sem Mustache triple-stache {{{ }}} com conteúdo não sanitizado.
  • Dados dinâmicos escapados em FreeMarker.
  • Domínio do próprio Fluig acessado via API pública, com a URL montada a partir de WCMAPI.getServerURL().
  • Comportamento preservado em relação ao original.

Tudo em conformidade com context/conventions.md e context/platform-constitution.md.

Exemplo de Uso

Antes (inseguro — input do usuário direto em innerHTML):

javascript
// ❌ vetor de XSS: userInput não confiável vai direto ao DOM como HTML
container.innerHTML = userInput;

Depois (texto puro com textContent, ou HTML sanitizado com DOMPurify.sanitize):

javascript
// ✅ quando basta texto: sem interpretação de HTML
container.textContent = userInput;

// ✅ quando HTML é necessário: sanitizar antes de inserir
container.innerHTML = DOMPurify.sanitize(userInput);

// ✅ quando o objetivo é eliminar qualquer HTML, reduzindo a texto puro
const safeText = WCMAPI.validateXSS(userInput);

Checklist de Validação

  • Toda entrada do usuário é sanitizada com DOMPurify.sanitize e/ou WCMAPI.validateXSS.
  • Não há innerHTML inseguro (usa textContent ou conteúdo sanitizado).
  • Não há eval() nem new Function() com dados dinâmicos.
  • Dados dinâmicos em FreeMarker estão escapados (${value?html} / ${value?js_string}).
  • Mustache triple-stache {{{ }}} (ou {{& }}) só é usado com conteúdo sanitizado por DOMPurify.
  • Domínio do próprio Fluig acessado via API pública, com a URL montada a partir de WCMAPI.getServerURL().
  • Sanitização aplicada tanto na entrada (POST/PUT) quanto na exibição (GET).
  • Comportamento do código preservado após a sanitização.

Frequently asked questions

What does the Fluig Validate Security AI skill do?

Sanitiza entradas e previne vulnerabilidades de frontend Fluig (XSS, innerHTML inseguro, eval/new Function com dados dinâmicos, escape FreeMarker ?html/?js_string, cuidado com Mustache triple-stache {{{ }}}, acesso a rota interna não documentada do Fluig) usando as APIs públicas WCMAPI.validateXSS (API oficial de alto nível, que internamente usa FLUIGC.utilities.preventXSS) e DOMPurify.sanitize. Use quando precisar validar/sanitizar código client-side de customização que manipula entrada do usuário no DOM, na persistência ou na exibição.

Why use Fluig Validate Security on TypingMind?

Because you install it once and use it with any model. Fluig Validate Security is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fluig Validate Security in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/totvs/fluig-agent-skills/tree/main/skills/fluig-validate-security. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Fluig Validate Security?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fluig Validate Security?

As many as you like. As long as a model supports skills, you can use Fluig Validate Security with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fluig Validate Security AI skill free?

Yes. It is published on GitHub by totvs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇