403 Forbidden error occurs when AJAX value %27 is triggered

Stack Overflow has seen a multitude of inquiries related to apostrophes in form fields, particularly concerning unencoded values. An insightful post sheds light on the limitations of using encodeURIComponent(str) for handling apostrophes and suggests creating a custom function instead:

    function rfc3986EncodeURIComponent (str) {...

However, my issue arises when attempting to encode the apostrophe (%27) in a value for an AJAX call from JavaScript – I consistently receive a 403 Forbidden error. This error is immediate upon response from Tomcat (8.5), indicating no application processing occurring on the server.

The following scenarios illustrate this challenge:

./application/processSomeAction.action?encodedValue=abc%27 Results in a 403 Error.

./application/processSomeAction.action?encodedValue=abc%2a Processes fine.

./application/processSomeAction.action?encodedValue=abcd Processes fine.

Notably, the AJAX call is written in pure JavaScript without reliance on JQuery.

Does this suggest that RFC 3986 sub-delimiters are prohibited in AJAX calls?

Answer №1

It was discovered that the issue was actually due to a restriction on the proxy server, not related to Chrome, Tomcat, or JavaScript. I apologize for not identifying the solution earlier.

The Siteminder agent automatically scans for the three most common vulnerable cross-site scripting characters: Less than sign, Greater than sign, and single quote (apostrophe) < > ‘

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize the UseQuery graphql function in conjunction with the useState hook within useEffect, allowing for the execution of an additional useEffect to update additional state

In my NextJS project, I am utilizing Apollo for graphQL queries and encountering an issue with the stateData.allProducts section. Despite setting the state in the useEffect and including data as a dependency in the array, the error claims it is null when d ...

Tips on efficiently reusing a variable

As someone who is relatively new to Jquery and Javascript, I have been attempting to search for a solution to my question on this platform. However, it seems that the terminology I am using may not be accurate enough to yield relevant results. If there is ...

Obtaining localStream for muting microphone during SIP.js call reception

My approach to muting the microphone involves using a mediastream obtained through the sessionDescriptionHandler's userMedia event. session.sessionDescriptionHandler.on('userMedia', onUserMediaObtained.bind(this)) function onUserMediaObta ...

Extracting Object Properties in JavaScript with React

Code: const [obj, setObj] = useState(() => ({ a: valueA, b: valueB, get values() { if (!this.a || !this.b) { return []; } // code... } return [this.a, this.b] }, })); Values update: useEf ...

What causes the URL to be undefined after making a JQuery Ajax POST request?

After performing an Ajax Post within a Profile View, I am attempting to refresh the view. Here is the code snippet: $.ajax({ url: '/Profile/Index', dataType: "html", type: "POST", data: JSON.stringify(10), success: ...

Encountering a MiniCssExtractPlugin error while trying to build with npm

I have encountered an issue while trying to execute "Npm Run Build" on my reactjs website. The error message I keep receiving is as follows: /usr/local/lib/node_modules/react-scripts/config/webpack.config.js:664 new MiniCssExtractPlugin({ ^ TypeErr ...

XPath Selector in Puppeteer version 22.x

Despite poring over the latest Puppeteer v22.x documentation on XPath, I am still struggling to grasp how to effectively utilize XPath in Puppeteer 22.x. My goal is to click on an element that contains the text 'Next'. Here's the HTML snipp ...

What is the best way to sequentially invoke an asynchronous function within an Observable method?

Presently, I have the following method: public classMethod( payload: Payload, ): Observable<Result> { const { targetProp } = payload; let target; return this.secondClass.secondClassMethod({ targetProp }).pipe( delayWhen(() ...

Conflicting Joomla Modules

I'm currently working on a project at the following link: www.eltotaldesign.com/planeteco Within this project, I have integrated the modules DJ Image Slider and Altra Switcher. Despite attempting to install Easy JQuery and other methods, I have been ...

Retrieve the most recently added item in the Material-ui Autocomplete component

Currently, I am incorporating the material-ui Autocomplete component with multiple selection feature. In one specific scenario, I require the ability to retrieve only the value of a newly added item. Despite utilizing the onChange listener, the event pro ...

execute a rigorous compilation during the ng build angular process

I am currently working on a project using angular-cli and I have configured my package.json with the following scripts: "scripts": { "ng": "ng", "build": "ng build --base-href /test/", "prod": "ng build --prod --base-href /test/" } According to the ...

Is there a way to search through a list and apply filters based on parameters found within a nested object?

I have a list that needs to be filtered based on parameters from advancedSearchFilters, which contains nested objects. The goal is to return a list that matches all or any of the specified parameters. const list = [ { additionalPrices: 0, clien ...

Tips for creating a customized dropdown menu that opens upwards without relying on Bootstrap

Looking for some assistance with creating an animated dropdown menu that slides upwards. Any help is appreciated! $('.need-help').click(function() { $('.need_help_dropdown').slideToggle(); }); .need-help { background:url(../im ...

After employing a forEach loop to generate a new array using the push method, the resulting array turns out to be devoid of any elements once the

I'm struggling to understand why my const becomes empty after a forEach loop. I've tried researching, but the answers I found didn't help me grasp the concept. I suspect it has something to do with JavaScript being asynchronous, but I can&ap ...

Modifying the color of a specific node in jstree

I am attempting to modify the background color of the node I have selected in jstree. $('#syncrep').jstree({ 'core' : { 'data' : repository ...

Form-linked Progress Bar

This is a little project I created (for fun and learning purposes, even though it may not be the most optimized solution). If you're interested, here's the link to the code: https://codepen.io/paschos/pen/xxGXMQb I'm currently seeking assi ...

What is the best way to rotate a cube when it is clicked on?

My current project involves rotating a cube by clicking on buttons either on the cube itself or floating next to it. At the moment, I have them floating for easier testing purposes, but placing them directly on the cube is not an issue. The main issue I&a ...

Utilizing Bootstrap Modal to Display PHP Data Dynamically

Modals always pose a challenge for me, especially when I'm trying to work with someone else's code that has a unique take on modals that I really appreciate (if only I can make it function correctly). The issue arises when the modal is supposed ...

Encountered an error message stating 'Unexpected Token <' while attempting to launch the node server

After adapting react-server-example (https://github.com/mhart/react-server-example), I encountered an issue with using JSX in my project. Despite making various changes like switching from Browserify to Webpack and installing babel-preset-react, I am still ...

Tips for refreshing the modified toggle in angular2

I currently have a newsletter subscription that is initially set based on the newsletter I receive when the user logs in. However, when I toggle the newsletter option, I receive a "successfully updated" message but the newsletter remains set to false even ...