Programmer's Ultimate Security DeskRef

Programmer's Ultimate Security DeskRef JScript

compile

Prototype: compile(pattern[, flags])

Summary: Compiles a regular expression.

Description: The compile method compiles a regular expression so that it can be efficiently re-used. It accepts a pattern and optional flags. The flag is any combination of "g", "i", or "m", for global match, ignore case, or multiline search.

Risk: This function is used to compile code. Syntax errors in the string being executed can lead to errors in other areas of the code. To ensure code continues to be executed as intended it is important to guard the usage of this function carefully. Otherwise, unpredictable results may occur which can compromise the system.

Proper Usage: compile("match[0-9]+", "g")

Additional Resources: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsorimethods.asp

Impact: Low

encodeURI

Prototype: string encodeURI(string)

Summary: Encodes a string into a URI.

Description: The encodeURI method encodes a string into a Uniform Resource Identifier. It accepts the string to be encoded and returns a string containing the valid URI. This method will not encode the characters ":", "/", ";", or "?".

Risk: Inputs received after encoding may need to be decoded before being processes, otherwise there is the risk that malicious or otherwise invalid strings can be passed through the application.

Additional Resources: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsorimethods.asp

Impact: Medium

Cross Reference: encodeURIComponent

encodeURIComponent

Prototype: string encodeURIComponent(string)

Summary: Encodes a string into a URI.

Description: The encodeURIComponent method encodes a string into a Uniform Resource Identifier. It accepts the string to be encoded and returns a string containing the valid URI. This method will encode all characters, so be...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Measurement While Drilling (MWD) Systems
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.