![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
node-iframe
Advanced tools
Readme
create iframes to bypass security issues on your server with node.js can also be used on the client
npm install node-iframe
as express middleware
const createIframe = require("node-iframe");
app.use(createIframe);
app.get("/iframe", (req, res) =>
res.createIframe({
url: req.query.url,
baseHref: req.query.baseHref, // optional: determine how to control link redirects,
config: JSON.parse(req.query.config), // optional: determine element cors or inlining #shape src/iframe.ts#L34
})
);
On the client use directly in your iframe if your api is on the same server set the url below like this or if your using a framework like gatsby, nextjs, etc or non-express apps
<iframe src="/iframe/?url=https://www.etsy.com" />
You can even fetch the iframe directly by importing fetchFrame
on the client or server.
const { fetchFrame } = require("node-iframe");
async function fetchIframe() {
return await fetchFrame({ url: "https://www.etsy.com" });
}
Configure how to handle resources for all request
const {
configureCacheControl,
configureResourceControl,
configureTemplates,
} = require("node-iframe");
// optional: configure if elements should be inlined, cors, etc, this combines with the `config` param
configureResourceControl({
inline: { script: true, link: false },
cors: { script: true },
});
// optional: configure cache-control, to disable cache set `disabled` to true - check https://github.com/node-cache/node-cache#options
// for more options and info
configureCacheControl({ stdTTL: 0, checkperiod: 600, disabled: false });
// optional: configure error-pages - check src/templates for more info
// 0: error, 1: not-found, 2: all templates - check src/templates/config for options
configureTemplates("<div>No Fish found</div>", 1);
MIT
FAQs
create iframes on your server to bypass CORS. Reverse engineer security issues.
The npm package node-iframe receives a total of 105 weekly downloads. As such, node-iframe popularity was classified as not popular.
We found that node-iframe demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.