Skip to content

chore: add Hacktron AI security review configuration - #42067

Merged
subrata71 merged 3 commits into
releasefrom
chore/hacktron-security-config
Jul 30, 2026
Merged

chore: add Hacktron AI security review configuration#42067
subrata71 merged 3 commits into
releasefrom
chore/hacktron-security-config

Conversation

@subrata71

@subrata71 subrata71 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds Hacktron AI configuration to enable automated security code review on every PR with Appsmith-specific context.

Files added

  • .hacktron/rules.md — Project rules giving Hacktron deep understanding of Appsmith's security model:

    • Public disclosure policy (no PoCs or exploitation steps in public PR comments)
    • Authorization model (service-layer ACL, not repository-level)
    • Git/filesystem safety invariants
    • SSRF/egress control boundaries
    • XSS/browser security boundaries
    • Mass assignment and policy mutation risks
    • CI supply chain attack surface
    • CSRF, sessions, and redirect safety
    • Multi-tenant cache isolation requirements
    • Intended datasource behavior (editors write queries — that's not injection)
  • .hacktron/config.yaml — Scan configuration:

    • Excludes markdown-only PRs (no exploitable code)
    • hacktron-exclude label as maintainer escape hatch
    • Gates on critical severity during calibration week, then escalate to high

Why this matters

Hacktron learns from project rules and triage feedback. Without rules, it doesn't know that:

  • Repository methods intentionally omit ACL checks (service layer enforces)
  • RFC1918 access is intentional for self-hosted datasource connectivity
  • App editors writing JS/SQL is intended functionality, not injection
  • React text interpolation is safe

This will significantly reduce false positives while ensuring real vulnerabilities (BOLA, path traversal, command injection, SSRF bypasses) are caught.

Public disclosure safeguard

Since this is a public repository, rules.md includes an explicit disclosure policy instructing Hacktron to never publish exploitation details, PoC payloads, or step-by-step reproduction in public PR comments. Full details remain in the private Hacktron dashboard.

Next steps after merge

  1. Review the auto-generated threat model after first scan
  2. Actively triage findings for 1 week (calibrate the model)
  3. Escalate fail_on.severity from critical to high
  4. Upload architecture docs and past CVE lessons to Hacktron dashboard
  5. Connect Slack notifications
  6. Add .hacktron/** to CODEOWNERS

Warning

Tests have not run on the HEAD 7f4be3a yet


Wed, 29 Jul 2026 18:56:56 UTC

Fixes https://linear.app/appsmith/issue/APP-15738/integrate-hacktron-ai-security-review-and-optimize-configuration

Summary by CodeRabbit

  • Documentation / Security
    • Added security scanning configuration defining rule sourcing behavior, PR exclusion via a dedicated label, Markdown scan exclusions, and severity escalation expectations.
    • Introduced a comprehensive security review ruleset outlining required authorization checks, injection/execution safety, outbound request/SSRF reporting, and client-side XSS boundaries.
    • Included guidance to minimize noisy findings and avoid public disclosure in documentation-only scenarios.

Add project rules and scan configuration for Hacktron AI, which performs
automated security code review on every pull request.

- .hacktron/rules.md: Appsmith-specific security context covering
  authorization model, Git/filesystem safety, SSRF controls, XSS
  boundaries, CI supply chain, CSRF/sessions, mass assignment, and
  multi-tenant caching. Includes a public disclosure policy to prevent
  Hacktron from publishing PoC exploits or reproduction steps in public
  PR comments.

- .hacktron/config.yaml: Scan exclusions for markdown-only changes and
  a maintainer-controlled escape-hatch label. Gates merge on critical
  severity findings during initial calibration (escalate to high after
  week 1).
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Added Hacktron scanning configuration and comprehensive Appsmith CE security review rules covering disclosure, authorization, execution, networking, browser, datasource, session, CI, tenancy, secrets, and noise reduction.

Changes

Hacktron security review

Layer / File(s) Summary
Hacktron scanning configuration
.hacktron/config.yaml
Configures default-branch rule loading, PR label and Markdown exclusions, and a critical severity failure threshold.
Review context and authorization rules
.hacktron/rules.md
Defines disclosure constraints, trust boundaries, authorization checks, and object graph and ownership validation guidance.
Security boundary review rules
.hacktron/rules.md
Documents criteria for filesystem and command execution, SSRF, XSS, datasources, sessions, CI, multi-tenant processing, sensitive data, and reporting noise.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • appsmithorg/appsmith-ee#9396 — Adds Hacktron integration using the same configuration and rules files.

Suggested reviewers: wyattwalter

Poem

Hacktron wakes with rules in flight,
Guarding paths and secrets tight.
Queries, sessions, shells align,
Trust boundaries draw the line.
Critical sparks now light the way.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Hacktron AI security review configuration.
Description check ✅ Passed The description includes summary, motivation, key files, safeguards, and issue link; it only omits some template sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/hacktron-security-config

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jul 29, 2026
@subrata71 subrata71 added the hacktron-exclude Skip Hacktron security scan for this PR label Jul 29, 2026
@subrata71 subrata71 self-assigned this Jul 29, 2026
@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

APP-15738

@subrata71
subrata71 marked this pull request as ready for review July 29, 2026 18:48
@subrata71
subrata71 requested a review from a team as a code owner July 29, 2026 18:48
@subrata71
subrata71 requested a review from wyattwalter July 29, 2026 18:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.hacktron/config.yaml (1)

8-10: 🔒 Security & Privacy | 🔵 Trivial

Security Misconfiguration (CWE-16)

Keep the escape-hatch label maintainer-only and auditable.

Applying hacktron-exclude skips the PR scan, so repository permissions and audit procedures should prevent untrusted contributors from applying it. (docs.hacktron.ai)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.hacktron/config.yaml around lines 8 - 10, Restrict application of the
hacktron-exclude label to trusted maintainers through repository permissions,
and ensure its use is covered by the repository’s audit procedures. Preserve the
existing exclude.labels configuration while enforcing that untrusted
contributors cannot apply this scan-bypass label.
.hacktron/rules.md (1)

145-155: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Apply the private-address policy consistently across address families.

The rules explicitly report IPv6 ULA access but exempt RFC1918 access unless a strict-private policy is bypassed. Define that policy once and apply it consistently, or legitimate self-hosted internal connectors may be classified differently based only on IP family.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.hacktron/rules.md around lines 145 - 155, Update the network-access
reporting rules around the private-address exception to define one
operator-enabled strict-private-address policy covering both IPv4 RFC1918 and
IPv6 ULA ranges. Apply that shared policy consistently when classifying HTTP and
non-HTTP connectors, while continuing to report loopback, link-local, and
metadata-service access independently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.hacktron/rules.md:
- Around line 211-218: Revise the “Multi-tenant caches and asynchronous
processing” rule to permit retries that preserve the original authorization
context and propagate failures unchanged. Keep prohibitions on onErrorResume,
defaultIfEmpty, or fallback data that allow failed mutations to proceed, and
restrict the retry prohibition to cases that change authorization context or
bypass a failed mutation.
- Around line 187-190: Update the CSRF guidance in the state-changing GET/HEAD
request rule to require browser-managed credentials and absent or insufficient
CSRF protection before classifying a route as vulnerable. Preserve review
coverage for CSRF exemptions, cookie attributes, anonymous endpoints, permit-all
matchers, login/logout, OAuth state, and session rotation, while excluding
routes protected by non-cookie authentication or equivalent controls.

---

Nitpick comments:
In @.hacktron/config.yaml:
- Around line 8-10: Restrict application of the hacktron-exclude label to
trusted maintainers through repository permissions, and ensure its use is
covered by the repository’s audit procedures. Preserve the existing
exclude.labels configuration while enforcing that untrusted contributors cannot
apply this scan-bypass label.

In @.hacktron/rules.md:
- Around line 145-155: Update the network-access reporting rules around the
private-address exception to define one operator-enabled strict-private-address
policy covering both IPv4 RFC1918 and IPv6 ULA ranges. Apply that shared policy
consistently when classifying HTTP and non-HTTP connectors, while continuing to
report loopback, link-local, and metadata-service access independently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0208d296-6d85-4923-aca1-d12fd6e6b6e0

📥 Commits

Reviewing files that changed from the base of the PR and between 867de31 and 456237c.

📒 Files selected for processing (2)
  • .hacktron/config.yaml
  • .hacktron/rules.md

Comment thread .hacktron/rules.md Outdated
Comment thread .hacktron/rules.md Outdated
- CSRF: require browser-managed credentials + missing protection, not
  just state-changing GET alone
- Retries: allow retries preserving auth context; only flag those that
  swallow failures or change authorization context
@subrata71
subrata71 merged commit 8ac6dc9 into release Jul 30, 2026
21 checks passed
@subrata71
subrata71 deleted the chore/hacktron-security-config branch July 30, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktron-exclude Skip Hacktron security scan for this PR skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants