Test and debug

Security scan

Scan your project for vulnerabilities, read what each check found, and fix it before you publish.

The Security scanner checks your project for exposed secrets, injection, weak access control and other common vulnerabilities. It runs inside your project's sandbox, lists what it found, and can hand the findings to the AI to fix. Serious findings stop a publish until you deal with them.

The Security tab in DevTools with the last score, Run again and Deep scan, and the coverage list of every check the scan runs.

What you can do

  • Run a Quick scan, or a Deep scan for a fuller review.
  • See 20 checks, each marked passed, failed or not run.
  • Go through a 29-point security checklist for your site, in plain words.
  • Check which security headers your live site really sends.
  • Look back at the scans saved with each publish, and download a report.
  • Read each finding with its severity, file, line, why it matters and how to fix it.
  • Send one finding, or all of them, to the AI to fix.
  • Ignore a finding that is not a risk in your project, with a reason.
  • Write project notes that help the deep scan.
  • See every package your project uses and the known advisories against it.

Run a scan

  1. Open Security

    Open DevTools from the bottom bar of the editor and choose the Security tab.

  2. Pick a depth

    Choose Run scan in the header, or Run again after a first scan: it runs a quick scan. More actions holds both depths:

    • Quick scan looks at the code, the secrets, the packages, the configuration and, if your project has a database, its row level security.
    • Deep scan does all that, then asks the AI to review your routes and data access. It takes longer. Some checks can only be settled by a deep scan.
  3. Read the result

    The header shows the score (Secure, Needs review or At risk), how many issues the scan found in how many files, the change since the last scan, and which scan ran. The status bar at the bottom says whether the result is Up to date or Out of date. Checks that did not run are folded into one row, Checks that did not run, with Run deep scan when a deep scan can settle them.

You can also ask the AI in the chat to check your project for security issues. It runs the same scan.

The 20 checks

ChecksWhat they look for
Cross-site scripting, SQL injection, Command injection, Code injection, Input validationUntrusted input that reaches HTML, a query, a shell or eval without checks, and SVG pictures in your public folder that hold a script.
SecretsAPI keys, tokens and passwords written in the code or in files the app serves.
Access control, AuthenticationRoutes and data that anyone can reach without signing in or without the right role.
Row level securityDatabase tables that are open to every visitor.
Information disclosureError details, source maps or data that should stay private, and logs, dumps, backups or keys left in your public folder, where anyone can download them.
Server-side request forgery, Path traversal, Open redirectRequests, file paths and redirects that a visitor can steer.
CORS, Security headersServer and browser settings that make attacks easier.
CryptographyWeak or misused hashing and encryption.
DependenciesPackages with known vulnerabilities.
Cross-site request forgery, File upload, Rate limitingForms, uploads and endpoints that can be abused.

The checklist

The Checklist tab, next to Problems and Dependencies, answers a 29-point security checklist for your site. Points are in two groups: Essentials (HTTPS, secrets, sign-in, data access, injection, backups and more) and Attack classes (the kinds of attack sites meet most). The top line says how many points pass and how many need attention.

Each point has one status:

StatusWhat it means
PassedThe scan checked it and found nothing.
1 finding, 2 findings...The scan found a problem. Choose Show findings to see only the findings behind this point in Problems.
Not checkedThe scan could not check it yet. The row says why, and offers Run a deep scan or Open Lyna Cloud when that is what it needs.
Provided by LynaLyna's hosting answers it for every published site, such as HTTPS and protection against floods of traffic.
Not used by this siteIt does not apply, for example database points on a site with no database. The row says why.
Yours to checkNo scan can answer it, such as backups and a recovery plan. Check it yourself.

A point is never shown as passed because the scan could not read something: when part of the scan did not run, the point reads Not checked.

Live site

Above the checklist, Live site shows which security headers your published site really sends: Stays on HTTPS, Content security policy, File types enforced and Referrer policy, each Sent or Missing. Choose Check live site to read them again. Before you publish, it says Publish your site to check it live.

Scan history and report

In More actions, Scan history lists the scans saved with each publish, with their score and findings. Download report saves the result on screen as a file you can share.

Not run is never clean

A check only passes when the scan could really check it. When it could not, the check is listed under Checks that did not run with the reason, for example:

  • Connect a database to check this, for row level security when the project has no database.
  • Run a deep scan to verify this, for checks such as access control and authentication after a quick scan.
  • The code scanner did not run, when part of the scan failed.

If some parts of the scan did not run, the panel says so: the result is not a clean bill of health. Run the scan again, or run a deep scan.

Findings

The Problems tab lists the findings. Group by Check, File or Severity, filter by severity (Critical, High, Medium, Low and Info) in All severities, or type in Filter problems. Select a finding to see its category and check, What was found, the Code that triggered it, Why it matters and How to fix.

  • Fix with agent asks the AI to fix that finding.
  • Reference in chat adds it to your message so you can ask about it.
  • In More actions, Fix all or Send all to AI hands every finding to the AI at once.

When your code changes after a scan, the result is Out of date and the fix actions are turned off, so the AI never works from old line numbers. Run the scan again first.

Ignore a finding

If a finding is not a risk in your project, open the finding and choose Ignore this finding in its actions. Explain Why is this not a risk?, then choose Ignore finding.

An ignored finding stays in the project with your reason; turn on Show waived findings in More actions to list it, in its own group. It no longer counts in the score and does not block publishing. Choose Restore to count it again.

Ignored findings are saved in your project, in .lyna_ai/security/ignored.json, so they are part of your Git history and your team can see them.

Project notes

Some facts cannot be read from the code: who signs in, which data is private, which risks your team accepts. Write them in Project notes, in More actions. The deep scan reads them as context. They are saved in .lyna_ai/security/memory.md.

Dependencies

The Dependencies tab shows every package your project uses, its version, its advisories and the version that fixes each one. Search it or turn on Vulnerable only; Fix on a package asks the AI to update it. Scan dependencies and Download list are in More actions. Packages only used in development are marked Dev.

Publishing and security

When you publish, Lyna checks the latest scan. The review step also shows how many security points pass, with See the checklist. Once your site is live, Lyna checks its security headers and tells you if any is missing. Neither line blocks a publish.

FindingEffect on publish
Critical or high, in your code or databaseBlocks publishing
Critical or high, in a packageAdvisory
Medium, low or infoAdvisory
IgnoredAdvisory

A blocked publish shows Resolve security issues before publishing. Fix the findings, ignore the ones that are not a risk, or choose Publish anyway.

FAQ

Need help?

Ask the team, read what changed, or learn from the blog.