Skip to content

feat(instructions): update security, a11y, and performance to 2025-2026 standards#1270

Merged
aaronpowell merged 15 commits intogithub:stagedfrom
gonzafg2:feat/update-security-a11y-performance-instructions
Apr 10, 2026
Merged

feat(instructions): update security, a11y, and performance to 2025-2026 standards#1270
aaronpowell merged 15 commits intogithub:stagedfrom
gonzafg2:feat/update-security-a11y-performance-instructions

Conversation

@gonzafg2
Copy link
Copy Markdown
Contributor

@gonzafg2 gonzafg2 commented Apr 2, 2026

Summary

Comprehensive update to 3 core instruction files, bringing them up to date with current standards (April 2026):

File Before After Key Change
security-and-owasp 51 lines, OWASP 2021 1025 lines, OWASP 2025 55 anti-patterns, AI/LLM security, 6 frameworks
a11y 307 lines, basic WCAG 727 lines, WCAG 2.2 AA 38 anti-patterns, legal context, 4 frameworks
performance-optimization 420 lines, generic tips 955 lines, CWV-focused 50 anti-patterns, Next.js 16/Angular 20, modern APIs

What changed

Security (security-and-owasp.instructions.md)

  • OWASP Top 10 2025 — Updated from 2021. New: A03 Supply Chain, A10 Mishandling Exceptions
  • 55 anti-patterns by category (Injection, Auth, Authorization, Secrets, Headers, Frontend, Dependencies, API, Logging)
  • AI/LLM Security (AI1-AI3): Prompt injection, LLM output sanitization, output validation
  • 6 frameworks: Next.js, Angular, React, Vue, Express, Go

Accessibility (a11y.instructions.md)

  • WCAG 2.2 AA criteria table (~35 criteria by POUR)
  • 38 anti-patterns: Semantic HTML, ARIA, Keyboard, Forms, Visual, Media
  • Legal context: EAA (June 2025), ADA Title II (April 2026), Section 508
  • Modern patterns: native <dialog>, inert attribute, WCAG 3.0 note

Performance (performance-optimization.instructions.md)

  • Core Web Vitals with sub-metrics (LCP phases, INP phases, CLS sources)
  • 50 anti-patterns: Loading, Rendering, JS Runtime, CSS, Images, Bundle
  • Updated frameworks: Next.js 16 ("use cache"), Angular 20 (zoneless, incremental hydration), React 19 (Compiler), Vue 3.6 (Vapor Mode)
  • Modern APIs: Speculation Rules, View Transitions, LoAF

Anti-pattern format

Each anti-pattern has: severity, detection regex, standard reference (OWASP/WCAG/CWV), and framework-specific code fix.

Verified against

Copilot AI review requested due to automatic review settings April 2, 2026 18:38
@gonzafg2 gonzafg2 requested a review from aaronpowell as a code owner April 2, 2026 18:38
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ This PR targets main, but PRs should target staged.

The main branch is auto-published from staged and should not receive direct PRs.
Please close this PR and re-open it against the staged branch.

You can change the base branch using the Edit button at the top of this PR,
or run: gh pr edit 1270 --base staged

@gonzafg2 gonzafg2 changed the base branch from main to staged April 2, 2026 18:39
@gonzafg2 gonzafg2 requested a review from dvelton as a code owner April 2, 2026 18:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch 2 times, most recently from a2b7f8a to d9b0cf0 Compare April 2, 2026 18:46
@gonzafg2 gonzafg2 requested a review from Copilot April 2, 2026 18:50
@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch from d9b0cf0 to 13e0c81 Compare April 2, 2026 18:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch from 13e0c81 to f0ce380 Compare April 2, 2026 19:00
@gonzafg2 gonzafg2 requested a review from Copilot April 2, 2026 19:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch from f0ce380 to 0e54fd2 Compare April 2, 2026 19:23
@gonzafg2 gonzafg2 requested a review from Copilot April 2, 2026 19:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch from 0e54fd2 to 8a5a726 Compare April 2, 2026 20:24
@gonzafg2 gonzafg2 requested a review from Copilot April 2, 2026 20:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

…26 standards

Security: OWASP 2025 (55 anti-patterns, AI/LLM section, 6 frameworks)
Accessibility: WCAG 2.2 AA (38 anti-patterns, legal context EAA/ADA, 4 frameworks)
Performance: CWV (50 anti-patterns, Next.js 16, Angular 20, modern APIs)
@gonzafg2 gonzafg2 force-pushed the feat/update-security-a11y-performance-instructions branch from 8a5a726 to 5703e3b Compare April 2, 2026 20:34
@gonzafg2 gonzafg2 requested a review from Copilot April 2, 2026 20:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

…everity

- SSRF: replace "full DNS/IP validation" with accurate wording that
  acknowledges TOCTOU limitation
- V5: downgrade prefers-reduced-motion from IMPORTANT to SUGGESTION,
  remove 2.2.2 (A) reference since it's an AAA enhancement
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

The heading said "Weak Password Hash (MD5/SHA1)" but the detection
regex and BAD example both use SHA-256. Renamed to "Fast Hash for
Passwords" which better describes the actual anti-pattern.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@aaronpowell aaronpowell left a comment

Choose a reason for hiding this comment

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

The README needs to be updated with the change to the instructions. Run npm run build to update them.

Resolve .codespellrc conflict (added both Vertexes and nin).
Run npm run build to regenerate docs/README.instructions.md.
@gonzafg2
Copy link
Copy Markdown
Contributor Author

The README needs to be updated with the change to the instructions. Run npm run build to update them.

Got it.

Done!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

SC 4.1.1 Parsing is still present in the WCAG 2.2 spec but marked
as obsolete (always satisfied). Changed wording from "removed" to
"obsolete" for accuracy.
@gonzafg2
Copy link
Copy Markdown
Contributor Author

Merged upstream/staged, resolved .codespellrc conflict (added both Vertexes and nin), and ran npm run build to regenerate the README.

Also addressed Copilot's review comment: updated the WCAG 2.2 SC 4.1.1 note from "removed" to "obsolete (always satisfied)" for accuracy — the criterion is still present in the spec but has no normative effect.

CI should pass now.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Copy-pasting the I1 SQL injection example as a single block failed with a
TypeScript redeclaration error because both BAD and GOOD snippets used
`const result`. Rename to `unsafeResult`/`safeResult` so the block remains
copy-pasteable into a single scope.
The I3 command injection example used `execFileSync` in both BAD and GOOD
paths, which (a) redeclared `const output` in the same block and (b) blocks
the Node event loop in server handlers, amplifying DoS impact.

Switch the GOOD/BEST paths to a promisified `execFile` call with explicit
`timeout` and `maxBuffer` bounds, and rename variables to
`unsafeOutput`/`safeOutput` so the snippet stays copy-pasteable. Add a
trailing note recommending async child_process APIs for server code.
The AU6 heading claimed "Session Not Invalidated on Password Change" but
the mitigation example showed `req.session.regenerate`, which is the
canonical defense against session fixation on login rather than bulk
invalidation after a credential change.

Rename the anti-pattern to "Missing Session Regeneration on Login (Session
Fixation)" so it matches the example, and add a trailing note pointing to
the complementary practice of invalidating other active sessions for the
user on password change (e.g., via a `tokenVersion` counter).
The L1 "GOOD" snippet relied on an inline `onload="this.media='all'"`
handler on a `<link>` tag. Under a strict CSP that disallows
`'unsafe-inline'` / `script-src-attr 'unsafe-inline'`, inline event
handlers are blocked, so the stylesheet would never activate and users
would hit a styling regression.

Replace the pattern with build-time critical CSS extraction
(Critters/Beasties/Next.js `optimizeCss`) plus a normal
`<link rel="preload" as="style">` and standard `<link rel="stylesheet">`.
Add a trailing note explaining why the older inline-onload trick breaks
under strict CSP and how to defer non-critical CSS with an external
script when deferral is truly needed.
@aaronpowell aaronpowell merged commit 6ef9d3c into github:staged Apr 10, 2026
9 checks passed
@gonzafg2 gonzafg2 deleted the feat/update-security-a11y-performance-instructions branch April 10, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants