This morning, upon upgrading my Firefox browser to the latest version (from 22 to 23), some of the key aspects of my back office (website) stopped working.
Looking at the Firebug log, the following errors were being reported:
Blocked loading mixed active content "http://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
Blocked loading mixed active content "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"`
among other errors caused by the latter of the two above not being loaded.
What does the above mean and how do I resolve it?
I found this blog post which cleared up a few things. To quote the most relevant bit:
Mixed Active Content is now blocked by default in Firefox 23!
What is Mixed Content?
When a user visits a page served over HTTP, their connection is open for eavesdropping and man-in-the-middle (MITM) attacks. When a user visits a page served over HTTPS, their connection with the web server is authenticated and encrypted with SSL and hence safeguarded from eavesdroppers and MITM attacks.
However, if an HTTPS page includes HTTP content, the HTTP portion can be read or modified by attackers, even though the main page is served over HTTPS. When an HTTPS page has HTTP content, we call that content “mixed”. The webpage that the user is visiting is only partially encrypted, since some of the content is retrieved unencrypted over HTTP. The Mixed Content Blocker blocks certain HTTP requests on HTTPS pages.
The resolution, in my case, was to simply ensure the jquery includes were as follows (note the removal of the protocol):
<link rel="stylesheet" href="//code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css" type="text/css">
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"></script>
Note that the temporary 'fix' is to click on the 'shield' icon in the top-left corner of the address bar and select 'Disable Protection on This Page', although this is not recommended for obvious reasons.
UPDATE: This link from the Firefox (Mozilla) support pages is also useful in explaining what constitutes mixed content and, as given in the above paragraph, does actually provide details of how to display the page regardless:
Most websites will continue to work normally without any action on your part.
If you need to allow the mixed content to be displayed, you can do that easily:
Click the shield icon Mixed Content Shield in the address bar and choose Disable Protection on This Page from the dropdown menu.
The icon in the address bar will change to an orange warning triangle Warning Identity Icon to remind you that insecure content is being displayed.
To revert the previous action (re-block mixed content), just reload the page.
It means you're calling http from https. You can use src="//url.to/script.js" in your script tag and it will auto-detect.
Alternately you can use use https in your src even if you will be publishing it to a http page. This will avoid the potential issue mentioned in the comments.
In absence of a white-list feature you have to make the "all" or "nothing" Choice. You can disable mixed content blocking completely.
The Nothing Choice
You will need to permanently disable mixed content blocking for the current active profile.
In the "Awesome Bar," type "about:config". If this is your first time you will get the "This might void your warranty!" message.
Yes you will be careful. Yes you promise!
Find security.mixed_content.block_active_content. Set its value to false.
The All Choice
iDevelApp's answer is awesome.
Put the below <meta> tag into the <head> section of your document to force the browser to replace unsecure connections (http) to secured connections (https). This can solve the mixed content problem if the connection is able to use https.
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
If you want to block then add the below tag into the <head> tag:
<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">
Its given the error because of security.
for this please use "https" not "http" in the website url.
For example :
"https://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
"https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"
In the relevant page which makes a mixed content https to http call which is not accessible we can add the following entry in the relevant and get rid of the mixed content error.
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
If you are consuming an internal service via AJAX, make sure the url points to https, this cleared up the error for me.
Initial AJAX URL: "http://XXXXXX.com/Core.svc/" + ApiName
Corrected AJAX URL: "https://XXXXXX.com/Core.svc/" + ApiName,
Simply changing HTTP to HTTPS solved this issue for me.
WRONG :
<script src="http://code.jquery.com/jquery-3.5.1.js"></script>
CORRECT :
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
I had this same problem because I bought a CSS template and it grabbed a javascript an external javascript file through http://whatever.js.com/javascript.js. I went to that page in my browser and then changed it to https://whatever... using SSL and it worked, so in my HTML javascript tag I just changed the URL to use https instead of http and it worked.
To force redirect on https protocol, you can also add this directive in .htaccess on root folder
RewriteEngine on
RewriteCond %{REQUEST_SCHEME} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#Blender Comment is the best approach. Never hard code the protocol anywhere in the code as it will be difficult to change if you move from http to https. Since you need to manually edit and update all the files.
This is always better as it automatically detect the protocol.
src="//code.jquery.com
I've managed to fix this using these :
For Firefox user
Open a new TAB enter about:config in the address bar to go to the configuration page.
Search for security.mixed_content.block_active_content
Change TRUE to FALSE.
For Chrome user
Click the Not Secure Warning next to the URL
Click Site Settings on the popup box
Change Insecure Content to Allow
Close and refresh the page
I found if you have issues with including or mixing your page with something like http://www.example.com, you can fix that by putting //www.example.com instead
I have facing same problem when my site goes from http to https. We have added rule for all request to redirect http to https.
You needs to add the redirection rule for inter site request, but you have to remove the redirection rule for external js/css.
I just fixed this problem by adding the following code in header:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
#if (env('APP_DEBUG'))
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
#endif
Syntax for Laravel Blade, Remember to use it for debugging only to avoid MITM attacks and eavs-dropping
Also using
http -> https
for Ajax or normal JS Scripts or CSS will also solve the issue.
If your app server is weblogic, then make sure WLProxySSL ON entry exists(and also make sure it should not be commented) in the weblogic.conf file in webserver's conf directory. then restart web server, it will work.
Related
I have a simple PHP page that has a tags (links) to different pages.
I want for the pages those links go to - not to be able to retrieve the http referrer.
in other words: I want to hide the referrer.
googling I found this to put in the tag:
<meta name="referrer" content="none">
but it seems to not work on all browsers, mostly for those that don't support HTML5 so I need something better, and one that will work on mobile as well.
any ideas?
I also tried
header('Location: http://www.example.com/');
in PHP but that seems to hide the referrer for HTTPS only, not HTTP.
Make your links of the form:
Text
This is part of the communication between the client (computer displaying the web page) and another web server, so PHP has nothing to do with it.
I have a problem using meta tag viewport.
When I enter into my website through the domain name I hired (a redirection to use a more confortable URL) the viewport meta doesn't work, but if I use the original URL (really ugly and not useful at all, that's why I have a redirection) to access into my web the viewport works, look here I paste the URLs to let you try by yourself:
(HERE DOESN'T WORK) This is the redirection URL: http://padelcniinfinit.com/tag_test.php
(HERE WORKS) URL real of my WEB: http://aitor.rvfcursos.com/tag_test.php
How can be possible this? Any clue about how to fix it?
thanks guys!
The kind of redirection you are using works by embedding the destination page in a frameset, you can check this by displaying the page source or inspecting it through the developers tools of your browser. It's not an actual redirection (as in HTTP 3xx) but a page at a nice URL which embeds your ugly-URL page.
As such, the embedded page gets an invalid viewport value.
There may be some workarounds that you can use discussed in this thread.
So, on an android tablet I'm getting a 404() for site/apple-touch-icon.png. Which, the 404 makes sense because no such file exists. But what's more, that file is referenced no where in the markup. I understand that apparently this icon can be automatically sought out depending on the inclusion of certain mobile-related META tags, but no such tags are anywhere in the code either. With the exception of the title, description, and keyword tags the only meta tag in said code is a
<meta name='viewport' content="width=1000">
and from what I've found, this wouldn't cause this 404.
Additionally, the only time said 404 seems to occur is when the user 'logs in.' The user can log in from any page on the site, but navigating such pages normally causes no problems. The login flow takes the user to a designated url, performs validation etc. and then redirects the user back to wherever they came from. No meta tags are output prior to the redirect. But somewhere in this flow, the tablet's browser believes it needs to seek out the 'apple-touch-icon.png' file.
Does anyone have any ideas as to what might be the culprit? Is it the result of a redirect without any output? If so, how might I discourage the client from behaving as such? I'm just at a loss trying to figure out what's causing it.
In case someone thinks it relevant, the site is built with codeigniter, and the redirect is using their core method. Thanks very much for any help.
EDIT
To clarify, because I realize this was written poorly (my bad), the tablet is NOT getting a RESOURCE 404. The tablet's browser is actually navigating to the url of the non-existent file. The result is a dead page.
Apple devices make a request to apple-touch-icon or apple-touch-icon-precomposed.png to use that image as a bookmark for your site, similar to how desktop browsers request favicon.png.
Presumably the android devices are just copying the IOS behaviour as they are hoping an icon will be available in that location.
I'm seeing requests for this image, plus apple-touch-icon-precomposed.png too, in my Apache http log.
Obviously, I don't carry any apple content on my site. It's probably the result of either someone's client or their carrier botching an ad injection when they visit my site. Favicon requests would be .ico files. I'm thinking of having some fun and putting goatse up with those image names, lol.
I have a rotator link and I dont want to allow people to open it in iframe.
How to stop php process in iframe?
header("X-FRAME-OPTIONS: DENY");
does not work in firefox and chrome. my link is (EDITED)
Check the Access-control-allow-origin header.
It allows you to control which domain can access or frame your scripts.
You can choose between 3 values :
Only from the same domain
Only from a domain listed on a list you made
From anyone (wildcard)
Since PHP is never in an iframe but executed on the server side there is no way to reliably know if the request originated from an iframe on your site of not.
If your intention (which is not quite clear) is to make sure people don't put an iframe of your site on another site, then you can check for the referrer of the request etc. But most of it can be spoofed.
Update due to comment:
Then there is unfortunately no good standardized way of getting this type of information reliably. If you yourself had an iframe on your site and for some reason didn't want that to be able to call your script you could probably do this by adding some GET parameters via javascript or something. But since you have pretty good control over your own iframes this shouldn't be a problem.
But when it comes to determining of the request from the browser to your server originated in an iframe or not there is no information in the HTTP header to disclose this. The only thing you could possibly be informed about is if that iframe is from a page hosted on another domain.
But if you have an iframe on your own site, don't add any extra parameters to the request and access your script in it and then normally from the browser's main window the two requests will look the same on the server.
I'm not completely sure if I understand your question, but here's a list of things:
If you want to stop your page being loaded in an iframe, there's not easy way of doing that, if the browser is ignoring X-Frame-Options: DENY.
If you have a link the user can click that opens in the iframe, not the parent frame, you can use the base html tag, to specify to the browser to open any links you click in the parent frame, with <base target="_parent" />
If you want to redirect automatically, and that causes an issue when loaded in an iframe because you use headers to do it or something, you could probably use the base tag and some javascript to automate clicking on the link as an alternative
I am facing a small problem in my Facebook application. when I left single click any link, it will not work, but it will work perfectly when I tried to use right click and open in new window option. Please help me to find out the problem.
This is the URL, please check it http://apps.facebook.com/moviereviewforyou/
The code is:
<a href="{$url->reviewMovie($file.fkey)}">
<img src="{$url->img2($file.thumbnail)}" alt="{$file.ftitle}" width=100 height=100/>
</a>
Looks like you don’t have a (valid) SSL certificate – at least that’s the first thing my browser warns me about when I try to access your app (Facebook automatically redirects me to the HTTPS version of it’s page, because I have that option set in my account’s security settings).
And then you have your links href attributes set with a hard-coded "http://…" at the beginning, which is also not good when the user uses your app over HTTPS. Just use relative links instead of absolute URLs; or at least have them begin like "//example.com/…" (this lets the browser decide which protocol he has to use, based on the protocol used to request the page these links are embedded in).
The page you are referring to has the following in the <head> tag:
<noscript><meta http-equiv="X-Frame-Options" content="deny" /></noscript>
This is what denies showing the page in a frame. Remove this line, or set content to allow to let it show in the frame.
EDIT:
I noticed that the row I mentioned is in the header of FaceBook itself, not in yours. Are you referring to your page correctly? You shouldn't refer to the facebook page containing your page, but to your page directly.