Validation and Security Analysis

WebZone provides tools for detecting common code quality problems and potentially unsafe patterns in HTML, CSS, and JavaScript. The tools are designed for development assistance and preliminary analysis.

HTML Validation

HTML validation is powered by HTMLHint.

Usage

  1. Select HTML Validation.
  2. Paste HTML markup.
  3. Click Validate.
  4. Review any issues found.

Validation Rules

RulePurpose
Lowercase tagsCheck HTML tag capitalization
Lowercase attributesCheck attribute capitalization
No duplicate attributesIdentify repeated attributes
Double-quoted valuesCheck attribute value formatting
Tag pairingDetect selected mismatched or unclosed tags
Special character escapingIdentify improperly escaped characters
Unique IDsDetect duplicate element identifiers
Nonempty source attributesCheck source attribute values

Example

Input:

<DIV id="example">
  <img src="">
</DIV>

Depending on the configured HTMLHint rules, the validator may report uppercase tags or an empty source attribute.

Results

When problems are detected, WebZone reports information including:

  • Issue severity or type
  • Validation rule
  • Line number
  • Column number
  • Description

When no configured rule is violated, the tool reports that no issues were found.


CSS Validation

CSS validation is powered by CSSTree.

Usage

  1. Select CSS Validation.
  2. Paste your CSS.
  3. Click Validate.
  4. Review the reported findings.

Checks

The validator examines:

  • CSS parsing errors
  • Unknown properties
  • Invalid property values

Example

.example {
  color: not-a-color;
  invalid-property: test;
}

The validator may report invalid property values and unrecognized properties.

Important Limitations

Validation depends on CSSTree's property and syntax definitions.

Custom properties, vendor extensions, and newly introduced CSS features may require manual review.

A clean result does not guarantee that CSS will render identically across browsers.


HTML Security Scanning

WebZone includes a pattern-based HTML security scanner.

Usage

  1. Select Security Scan.
  2. Choose HTML.
  3. Paste HTML source.
  4. Click Scan.
  5. Review the findings.

Detection Categories

CategoryExamples
Content Security PolicyMissing CSP, selected unsafe directives
External linkstarget="_blank" without appropriate relationship attributes
Inline JavaScriptInline scripts and event handlers
Inline stylesStyle attributes
Unsafe URL schemesjavascript: references
Mixed contentHTTP resources and form actions
FormsSelected method and action issues
Script integrityExternal scripts without SRI attributes
IframesMissing sandbox attributes
Referrer controlsMissing referrer policy attributes

Example

<a href="https://example.com" target="_blank">
  Visit site
</a>

The scanner may recommend adding:

rel="noopener noreferrer"

Content Security Policy Recommendations

The HTML scanner also generates a suggested Content Security Policy template.

This template should be reviewed and adapted to your application's legitimate resource requirements.

Important: A Content Security Policy is generally best configured and verified through HTTP response headers. Some directives, such as frame-ancestors, are not supported through HTML meta-element CSP policies.


JavaScript Security Scanning

The JavaScript scanner identifies selected potentially dangerous coding patterns.

Usage

  1. Select Security Scan.
  2. Choose JavaScript.
  3. Paste JavaScript source.
  4. Click Scan.
  5. Review the findings.

Detection Categories

CategoryExample
Dynamic executioneval()
Dynamic function constructionnew Function()
String timersString arguments to timers
DOM writingdocument.write()
HTML injection sinksinnerHTML, outerHTML, insertAdjacentHTML
NavigationSelected location assignments
Global exposureProperties assigned to global objects
Cross-window messagingpostMessage() with wildcard origin
Insecure requestsHTTP fetch and XMLHttpRequest patterns
Cryptographic configurationSelected PBKDF2 iteration patterns

Example

const userInput = "2 + 2";
const result = eval(userInput);

The scanner identifies the use of eval() as a potentially unsafe pattern.

An appropriate solution depends on why dynamic execution was used.

Severity Levels

Findings are labeled:

SeverityMeaning
HIGHPattern prioritized for security review
MEDPotential concern requiring contextual assessment
LOWInformational or lower-priority concern

These labels are assigned by the scanner's rules. They are not measured exploitability scores.

Understanding Scan Results

A finding generally includes:

  • Severity
  • Rule identifier
  • Location
  • Explanation
  • Suggested remediation

Limitations

The scanner uses heuristic pattern matching. It is not a complete static application security testing engine.

Consequently:

  • Legitimate code may produce findings.
  • Dangerous code may go undetected.
  • Findings do not establish exploitability.
  • A clean result does not establish security.

Use WebZone as a preliminary review tool alongside appropriate testing and professional security assessment.

Best Practices

Review findings individually, understand the context, and test proposed changes before deploying them.

Do not rely on a clean scan alone as proof that an application is secure.


Did this page help you?