Security rules

Security rules

The 100 built-in NgBastion rules for Angular applications, with detection boundaries, examples and remediation.

CategorySeverityApplies toCWERecommended

100 of 100 rules

IDRuleSeverityApplies toCWE
NGB001Unsafe HTML trust bypassAngular security & XSShighBrowser appCWE-79
NGB002Unsafe resource trust bypassAngular security & XSShighBrowser appCWE-79, CWE-829
NGB003DOM injection sinkAngular security & XSShighBrowser appCWE-79
NGB004Dynamic code executionAngular security & XSScriticalBrowser appCWE-95
NGB005Untrusted dynamic script loadingAngular security & XSShighBrowser appCWE-829
NGB006Wildcard postMessage originiframe & cross-window communicationhighBrowser appCWE-201, CWE-345
NGB007Missing origin validationiframe & cross-window communicationhighBrowser appCWE-346, CWE-940
NGB008Unverified message sourceiframe & cross-window communication · warns in recommended mediumBrowser appCWE-346
NGB009Unvalidated message payloadiframe & cross-window communicationhighBrowser appCWE-20, CWE-940
NGB010Overly permissive iframeiframe & cross-window communication · warns in recommended mediumBrowser appCWE-1021, CWE-250
NGB011Untrusted redirectNavigation & authenticationhighBrowser appCWE-601
NGB012Unsafe navigation schemeNavigation & authenticationhighBrowser appCWE-79, CWE-601
NGB013Credential forwarding riskNavigation & authenticationhighBrowser appCWE-522, CWE-200
NGB014Insecure token storageSensitive data & payment securityhighBrowser appCWE-922
NGB015Sensitive payment data persistenceSensitive data & payment securitycriticalBrowser appCWE-312, CWE-922
NGB016Sensitive data loggingSensitive data & payment securityhighBrowser appCWE-532
NGB017Sensitive data in URLsSensitive data & payment securityhighBrowser appCWE-598
NGB018Hardcoded frontend secretsSensitive data & payment securityhighBrowser appCWE-798
NGB019Unsafe CSP / Trusted Types policySecurity configuration · warns in recommended mediumConfigurationCWE-693
NGB020Sensitive SSR transfer cacheAngular SSR securityhighServer / SSRCWE-524, CWE-200
NGB021Disabled XSRF protectionNavigation & authenticationhighBrowser appCWE-352
NGB022Authorization decision from user-controllable stateNavigation & authentication · warns in recommended mediumBrowser appCWE-602, CWE-807
NGB023Missing OAuth state validationNavigation & authenticationhighBrowser appCWE-352, CWE-345
NGB024Weakened OAuth/OIDC client configurationNavigation & authenticationhighBrowser appCWE-287, CWE-345
NGB025Authentication cookie set from JavaScriptSensitive data & payment securityhighBrowser appCWE-1004, CWE-614
NGB026Untrusted HTTP request destinationNavigation & authenticationhighBrowser appCWE-918, CWE-22, CWE-352
NGB027Sensitive data in DOM attributesSensitive data & payment security · warns in recommended mediumBrowser appCWE-200, CWE-312
NGB028Sensitive data on global objectsSensitive data & payment security · warns in recommended mediumBrowser appCWE-200, CWE-922
NGB029Sensitive data in navigation stateSensitive data & payment securityhighBrowser appCWE-200, CWE-922
NGB030Permissive referrer policySecurity configuration · warns in recommended mediumConfigurationCWE-200, CWE-598
NGB031Sensitive data in CacheStorageSensitive data & payment securitymediumBrowser appCWE-524, CWE-922
NGB032Service worker caches user-specific responsesSensitive data & payment securitymediumBrowser appCWE-524, CWE-525
NGB033window.open() without noopeneriframe & cross-window communication · warns in recommended lowBrowser appCWE-1022
NGB034Untrusted postMessage target originiframe & cross-window communicationhighBrowser appCWE-201, CWE-345
NGB035Untrusted dynamic method dispatchiframe & cross-window communicationhighBrowser appCWE-470
NGB036Prototype pollutionAngular security & XSShighBrowser appCWE-1321
NGB037Regular expression injectionAngular security & XSS · warns in recommended mediumBrowser appCWE-1333, CWE-400
NGB038Sensitive form submission targetSensitive data & payment securityhighBrowser appCWE-319, CWE-201
NGB039JSONP requestAngular security & XSSmediumBrowser appCWE-829, CWE-95
NGB040Plaintext network transportSensitive data & payment securitymediumBrowser appCWE-319
NGB041Unsafe inline state serializationAngular SSR securityhighServer / SSRCWE-79, CWE-116
NGB042Host header injection in SSRAngular SSR securityhighServer / SSRCWE-644, CWE-918, CWE-601
NGB043Insecure session cookie attributesAngular SSR securityhighServer / SSRCWE-1004, CWE-614, CWE-1275
NGB044Public production source mapsSecurity configuration · warns in recommended lowConfigurationCWE-540, CWE-200
NGB045Missing subresource integritySupply chain · warns in recommended mediumBuild & CICWE-353, CWE-829
NGB046Insecure randomness for security valuesCryptographyhighBrowser & serverCWE-338, CWE-330
NGB047Static IV in Web Crypto encryptionCryptographyhighBrowser & serverCWE-329, CWE-323
NGB048Weak hash algorithmCryptographymediumBrowser & serverCWE-328, CWE-327, CWE-916
NGB049Insecure dependency sourceSupply chainmediumBuild & CICWE-494, CWE-829
NGB050document.domain relaxationiframe & cross-window communicationmediumBrowser appCWE-942, CWE-346
NGB051Mismatched Angular sanitization contextAngular security & XSShighBrowser appCWE-116, CWE-79
NGB052Unsafe custom Angular sanitizerAngular security & XSShighBrowser appCWE-79, CWE-116
NGB053Runtime template compilation from dynamic inputAngular security & XSShighBrowser appCWE-1336, CWE-79, CWE-94
NGB054Untrusted base URLAngular security & XSShighBrowser appCWE-79, CWE-601, CWE-829
NGB055Cross-request state in SSR module scopeAngular SSR security · warns in recommended mediumServer / SSRCWE-488, CWE-200, CWE-362
NGB056Pass-through Trusted Types policyAngular security & XSShighBrowser appCWE-79, CWE-116
NGB057Missing OIDC nonceNavigation & authenticationmediumBrowser appCWE-294, CWE-345
NGB058ID token sent as API bearer tokenNavigation & authentication · warns in recommended mediumBrowser appCWE-287, CWE-863
NGB059JWT decoded without signature verificationAngular SSR securityhighServer / SSRCWE-347, CWE-345, CWE-287
NGB060Untrusted OAuth redirect URINavigation & authenticationhighBrowser appCWE-601, CWE-522
NGB061Server-side open redirectAngular SSR securitymediumServer / SSRCWE-601
NGB062Permissive Permissions-PolicySecurity configuration · warns in recommended lowConfigurationCWE-250, CWE-1021
NGB063DOM-clobberable global in a sensitive sinkAngular security & XSS · warns in recommended mediumBrowser appCWE-79, CWE-471
NGB064Untrusted CSS injectionAngular security & XSSmediumBrowser appCWE-79, CWE-74
NGB065Broken or weak cipherCryptographyhighBrowser & serverCWE-327
NGB066Sensitive data copied to the clipboardSensitive data & payment security · warns in recommended lowBrowser appCWE-200, CWE-359
NGB067Sensitive data sent to analyticsSensitive data & payment security · warns in recommended mediumBrowser appCWE-359, CWE-201
NGB068Hardcoded cryptographic keyCryptographyhighBrowser & serverCWE-321, CWE-798
NGB069Reflected XSS in server responsesAngular SSR securityhighServer / SSRCWE-79
NGB070Timing-unsafe secret comparisonAngular SSR securitymediumServer / SSRCWE-208
NGB071Service worker scope expansionSecurity configurationmediumConfigurationCWE-668, CWE-284
NGB072Service worker attaches credentials to any originSensitive data & payment securityhighBrowser appCWE-522, CWE-200
NGB073SQL injection in server codeAngular SSR securitycriticalServer / SSRCWE-89
NGB074Service worker caches unvalidated responsesSecurity configuration · warns in recommended mediumConfigurationCWE-349, CWE-524
NGB075Untrusted worker scriptAngular security & XSShighBrowser appCWE-829, CWE-94
NGB076Server-side request forgeryAngular SSR securityhighServer / SSRCWE-918
NGB077Path traversal in server codeAngular SSR securityhighServer / SSRCWE-22, CWE-73
NGB078OS command injectionAngular SSR securitycriticalServer / SSRCWE-78, CWE-88
NGB079Server-side template injectionAngular SSR securitycriticalServer / SSRCWE-1336, CWE-94
NGB080NoSQL injection in server codeAngular SSR securityhighServer / SSRCWE-943
NGB081Permissive CORS with credentialsAngular SSR securityhighServer / SSRCWE-942, CWE-346
NGB082Spoofable client IP used for access controlAngular SSR securityhighServer / SSRCWE-290, CWE-348
NGB083Cross-site WebSocket hijackingAngular SSR securityhighServer / SSRCWE-1385, CWE-346
NGB084Session not regenerated after loginAngular SSR security · warns in recommended mediumServer / SSRCWE-384
NGB085Error details sent to clientsAngular SSR securitymediumServer / SSRCWE-209, CWE-497
NGB086Static password-hashing saltCryptographymediumBrowser & serverCWE-760, CWE-916
NGB087Insufficient password-hashing work factorCryptographymediumBrowser & serverCWE-916, CWE-326
NGB088Insufficient asymmetric key sizeCryptographymediumBrowser & serverCWE-326
NGB089Truncated authentication tagCryptographymediumBrowser & serverCWE-326, CWE-347
NGB090Signature verification result ignoredCryptographyhighBrowser & serverCWE-347, CWE-252
NGB091Untrusted code in a privileged workflowSupply chaincriticalBuild & CICWE-829, CWE-94
NGB092Excessive workflow token permissionsSupply chainmediumBuild & CICWE-250, CWE-732
NGB093Third-party action not pinned to a commitSupply chainmediumBuild & CICWE-829, CWE-494
NGB094Untrusted expression in a workflow scriptSupply chainhighBuild & CICWE-78, CWE-94
NGB095Untrusted artifact in a privileged workflowSupply chainhighBuild & CICWE-829, CWE-494
NGB096Development server exposed to the networkSecurity configuration · warns in recommended lowConfigurationCWE-1327, CWE-350
NGB097Package manager TLS verification disabledSupply chainhighBuild & CICWE-295, CWE-494
NGB098TLS certificate validation disabledSecurity configurationhighConfigurationCWE-295
NGB099Untrusted module federation remoteSupply chainhighBuild & CICWE-829, CWE-494
NGB100Untrusted import mapSupply chainhighBuild & CICWE-829, CWE-494

NgBastion ships 100 built-in rules. Each page documents exactly which patterns the implementation recognizes, its known limitations and its false-positive considerations. A rule that is not listed here is not checked: the absence of findings never proves an application is secure.

Angular security & XSS (16) · iframe & cross-window communication (9) · Navigation & authentication (11) · Sensitive data & payment security (16) · Security configuration (8) · Angular SSR security (20) · Cryptography (10) · Supply chain (10)

Use the explorer above to filter by category, severity, where a rule applies, CWE and its level in the recommended preset. The full catalog by category follows.

Angular security & XSS

ID Rule Default severity
NGB001 Unsafe HTML trust bypass high
NGB002 Unsafe resource trust bypass high
NGB003 DOM injection sink high
NGB004 Dynamic code execution critical
NGB005 Untrusted dynamic script loading high
NGB036 Prototype pollution high
NGB037 Regular expression injection medium
NGB039 JSONP request medium
NGB051 Mismatched Angular sanitization context high
NGB052 Unsafe custom Angular sanitizer high
NGB053 Runtime template compilation from dynamic input high
NGB054 Untrusted base URL high
NGB056 Pass-through Trusted Types policy high
NGB063 DOM-clobberable global in a sensitive sink medium
NGB064 Untrusted CSS injection medium
NGB075 Untrusted worker script high

iframe & cross-window communication

ID Rule Default severity
NGB006 Wildcard postMessage origin high
NGB007 Missing origin validation high
NGB008 Unverified message source medium
NGB009 Unvalidated message payload high
NGB010 Overly permissive iframe medium
NGB033 window.open() without noopener low
NGB034 Untrusted postMessage target origin high
NGB035 Untrusted dynamic method dispatch high
NGB050 document.domain relaxation medium
ID Rule Default severity
NGB011 Untrusted redirect high
NGB012 Unsafe navigation scheme high
NGB013 Credential forwarding risk high
NGB021 Disabled XSRF protection high
NGB022 Authorization decision from user-controllable state medium
NGB023 Missing OAuth state validation high
NGB024 Weakened OAuth/OIDC client configuration high
NGB026 Untrusted HTTP request destination high
NGB057 Missing OIDC nonce medium
NGB058 ID token sent as API bearer token medium
NGB060 Untrusted OAuth redirect URI high

Sensitive data & payment security

ID Rule Default severity
NGB014 Insecure token storage high
NGB015 Sensitive payment data persistence critical
NGB016 Sensitive data logging high
NGB017 Sensitive data in URLs high
NGB018 Hardcoded frontend secrets high
NGB025 Authentication cookie set from JavaScript high
NGB027 Sensitive data in DOM attributes medium
NGB028 Sensitive data on global objects medium
NGB029 Sensitive data in navigation state high
NGB031 Sensitive data in CacheStorage medium
NGB032 Service worker caches user-specific responses medium
NGB038 Sensitive form submission target high
NGB040 Plaintext network transport medium
NGB066 Sensitive data copied to the clipboard low
NGB067 Sensitive data sent to analytics medium
NGB072 Service worker attaches credentials to any origin high

Security configuration

ID Rule Default severity
NGB019 Unsafe CSP / Trusted Types policy medium
NGB030 Permissive referrer policy medium
NGB044 Public production source maps low
NGB062 Permissive Permissions-Policy low
NGB071 Service worker scope expansion medium
NGB074 Service worker caches unvalidated responses medium
NGB096 Development server exposed to the network low
NGB098 TLS certificate validation disabled high

Angular SSR security

ID Rule Default severity
NGB020 Sensitive SSR transfer cache high
NGB041 Unsafe inline state serialization high
NGB042 Host header injection in SSR high
NGB043 Insecure session cookie attributes high
NGB055 Cross-request state in SSR module scope medium
NGB059 JWT decoded without signature verification high
NGB061 Server-side open redirect medium
NGB069 Reflected XSS in server responses high
NGB070 Timing-unsafe secret comparison medium
NGB073 SQL injection in server code critical
NGB076 Server-side request forgery high
NGB077 Path traversal in server code high
NGB078 OS command injection critical
NGB079 Server-side template injection critical
NGB080 NoSQL injection in server code high
NGB081 Permissive CORS with credentials high
NGB082 Spoofable client IP used for access control high
NGB083 Cross-site WebSocket hijacking high
NGB084 Session not regenerated after login medium
NGB085 Error details sent to clients medium

Cryptography

ID Rule Default severity
NGB046 Insecure randomness for security values high
NGB047 Static IV in Web Crypto encryption high
NGB048 Weak hash algorithm medium
NGB065 Broken or weak cipher high
NGB068 Hardcoded cryptographic key high
NGB086 Static password-hashing salt medium
NGB087 Insufficient password-hashing work factor medium
NGB088 Insufficient asymmetric key size medium
NGB089 Truncated authentication tag medium
NGB090 Signature verification result ignored high

Supply chain

ID Rule Default severity
NGB045 Missing subresource integrity medium
NGB049 Insecure dependency source medium
NGB091 Untrusted code in a privileged workflow critical
NGB092 Excessive workflow token permissions medium
NGB093 Third-party action not pinned to a commit medium
NGB094 Untrusted expression in a workflow script high
NGB095 Untrusted artifact in a privileged workflow high
NGB097 Package manager TLS verification disabled high
NGB099 Untrusted module federation remote high
NGB100 Untrusted import map high