Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
winchan
Advanced tools
Readme
Here's the scenario: You want to build a secure means of some untrusted site opening a window, which loads content at a trusted site. Then you want the untrusted dude to be able to pass in parameters. Then you want the trusted code to do any amount of stuff, and return a response.
This kinda thing is what lots of services on the web do, services like BrowserID.
Trouble is that this is stupidly hard:
WinChan is an abstraction to solve these problems and make it easy to open windows which take and return parameters and load content cross domain.
WinChan is expected to work on:
For the site spawning the window, the "untrusted" or "client" code:
WinChan.open({
url: "http://trusted.host/dialog.html",
relay_url: "http://trusted.host/relay.html",
window_features: "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=700,height=375",
params: {
these: "things",
are: "input parameters"
}
}, function(err, r) {
// err is a string on failure, otherwise r is the response object
});
For the site providing the window, the "trusted" code:
WinChan.onOpen(function(origin, args, cb) {
// origin is the scheme+host+port that cause window invocation,
// it can be trusted
// args are the untrusted arguments provided by the calling site
// and cb you can call within the function, or synchronously later.
// calling it indicated the window is done and can be closed.
cb({
"these things": "are the response"
});
});
Finally, you'll notice that the trusted code needs to host 'relay.html' somewhere (required for IE support).
there's a little tiny webserver in-tree to let you run the examples. You'll need node.js and npm installed. Once you have these, just:
$ npm i
$ scripts/run_example.js
Now load http://127.0.0.1:8100/example
(or the more complicated example which demonstrates
navigation away and back in window at http://127.0.0.1:8100/complex_example
node.js and npm are required to run the unit tests. Once installed
$ npm i
$ scripts/run_example.js
And open http://127.0.0.1:8100/test
in your favorite web browser.
NOTE: You'll need to disable popup blocking for localhost to run tests!
the run_example.js
script will bind whatever IP is in the IP_ADDRESS
env var.
So to test over the network:
$ npm i
$ IP_ADDRESS=<my external IP> scripts/run_example.js
(repace <my external IP>
with your IP address)
then hit http://<my external IP>:8100/test
FAQs
Here's the scenario: You want to build a secure means of some untrusted site opening a window, which loads content at a trusted site. Then you want the untrusted dude to be able to pass in parameters. Then you want the trusted code to do any amount of
The npm package winchan receives a total of 167,555 weekly downloads. As such, winchan popularity was classified as popular.
We found that winchan demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.