---
title: Javascript – Avoid Use Of Local Storage On Client Scripts
description: "Impact Area Security       Severity High       Affected Element Client Script Widget Widget Angular Provider UI Script ## Rule number **SN-0149** ## Impact Session storage and local storage are HTML 5 features which allow developers to…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/javascript-rules-rules-for-servicenow/javascript-avoid-use-of-local-storage-on-client-scripts/"
updated: "2025-03-21"
category: Best Practices Rules / JavaScript Rules
---

# Javascript – Avoid Use Of Local Storage On Client Scripts

Impact Area

Security

 

 

 

           Severity

High

 

 

 

           Affected Element

Client Script

Widget

Widget Angular Provider

UI Script

## Rule number

**SN-0149**

## Impact

Session storage and local storage are HTML 5 features which allow developers to easily store megabytes of data client-side, as opposed to the 4Kb cookies can accommodate. While useful to speed applications up on the client side, it can be dangerous to store sensitive information this way because the data is not encrypted by default and any script on the page may access it.

## Remediation

Avoid use of local storage in all client side code.

### Time to fix

45 min

## References

This rule is linked to [Common Weakness Enumeration CWE-539 Information Exposure Through Persistent cookies](https://cwe.mitre.org/data/definitions/539.html).
